恢复通知android上的当前背景活动

时间:2014-11-07 11:58:22

标签: java android

我的应用程序中有多个活动。我想在栏中显示通知并点击它时,它将从当前处于后台的活动中恢复。

目前,我正在使用此功能,但它总是会将我带到Home活动,即Launcher活动。

Intent intent =new Intent(ServiceClass.this, home.class);
PendingIntent pendingIntent = PendingIntent.getActivity(GcmIntentService.this, 0, intent, 0);

1 个答案:

答案 0 :(得分:0)

使用Android启动应用时使用的相同意图过滤器:

    final Intent notificationIntent = new Intent(context, YourActivity.class);
    notificationIntent.setAction(Intent.ACTION_MAIN);
    notificationIntent.addCategory(Intent.CATEGORY_LAUNCHER);
相关问题