Android: resume app from previous position

后端 未结 2 996
花落未央
花落未央 2020-12-06 06:30

How can I resume my app from its previous position.

Note that it is still active, just paused. So if I click the androids current app button, or the app icon it resu

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-06 07:15

    Use this it is same as android doing for your launcher activity

    Intent notificationIntent = new Intent(context, SplashActivity.class);
            notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
            notificationIntent.setAction(Intent.ACTION_MAIN);
            notificationIntent.addCategory(Intent.CATEGORY_LAUNCHER);
            PendingIntent clickActionIntent = PendingIntent.getService(context, 0, notificationIntent, 0);
    

提交回复
热议问题