本地版本
parent
abb51a0364
commit
68069af2b6
|
@ -91,6 +91,6 @@ kapt {
|
|||
}
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'com.finogeeks.lib:finapplet:2.38.10-alpha20221207v05'
|
||||
implementation 'com.finogeeks.mop:plugins:2.38.10-alpha20221207v05'
|
||||
implementation 'com.finogeeks.lib:finapplet:2.38.10-alpha20221209v01'
|
||||
implementation 'com.finogeeks.mop:plugins:2.38.10-alpha20221209v01'
|
||||
}
|
|
@ -1,38 +1,29 @@
|
|||
package com.finogeeks.mop.utils;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.finogeeks.lib.applet.client.FinAppClient;
|
||||
import com.finogeeks.lib.applet.client.FinAppProcessClient;
|
||||
import com.finogeeks.lib.applet.main.FinAppHomeActivity;
|
||||
import com.finogeeks.mop.interfaces.ICallback;
|
||||
|
||||
public class AppletUtils {
|
||||
public static void moveCurrentAppletToFront(Context context, ICallback<Object> callback) {
|
||||
try {
|
||||
if (FinAppClient.INSTANCE.isFinAppProcess(context)) {
|
||||
FinAppHomeActivity activity = (FinAppHomeActivity) FinAppProcessClient.INSTANCE.getAppletProcessActivity();
|
||||
if (activity != null) {
|
||||
activity.moveTaskToFront();
|
||||
}
|
||||
} else {
|
||||
String currentAppletId = FinAppClient.INSTANCE.getAppletApiManager().getCurrentAppletId();
|
||||
if (currentAppletId == null || TextUtils.isEmpty(currentAppletId)) {
|
||||
if (currentAppletId != null) {
|
||||
FinAppClient.INSTANCE.getAppletApiManager().moveTaskToFront(currentAppletId);
|
||||
}
|
||||
}
|
||||
if (callback != null) {
|
||||
callback.onFail(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
String activityName = FinAppClient.INSTANCE.getAppletApiManager().getAppletActivityName(currentAppletId);
|
||||
if (activityName == null) {
|
||||
if (callback != null) {
|
||||
callback.onFail(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (activityName.contains("@")) {
|
||||
activityName = activityName.substring(0, activityName.indexOf("@"));
|
||||
}
|
||||
Intent intent = new Intent(context, Class.forName(activityName));
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivities(context, 0, new Intent[]{intent}, 0);
|
||||
pendingIntent.send();
|
||||
callback.onSuccess(null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (callback != null) {
|
||||
|
|
Loading…
Reference in New Issue