|
|
@@ -243,11 +243,7 @@ public class ApexApplication extends Application {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public Class getMainActivityClass() {
|
|
|
- return Activity.class;
|
|
|
- }
|
|
|
-
|
|
|
- public void showNotification(NotificationContent content, String channelId, String channelName) {
|
|
|
+ public void showNotification(NotificationContent content, String channelId, String channelName, Class activityCls) {
|
|
|
if (content == null) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -256,7 +252,7 @@ public class ApexApplication extends Application {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- Intent intent = new Intent(getApplicationContext(), getMainActivityClass());
|
|
|
+ Intent intent = new Intent(getApplicationContext(), activityCls);
|
|
|
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); // getIntent可能是null
|
|
|
if (content.extra != null) {
|
|
|
intent.putExtra(NotificationContent.ExtraKey,content.extra); // 程序在后台的情况下,点击通知将程序唤醒到前台时,并不能取得extra
|