Android notification bar open last active activity?

前端 未结 2 1670
半阙折子戏
半阙折子戏 2021-01-03 01:54

I am creating like timer application and when I start timer I have option to go to android Home or start any other activity .

When I start timer I set a notificati

2条回答
  •  别那么骄傲
    2021-01-03 02:28

    I found an answer it's about flags : Android: new Intent() starts new instance with android:launchMode="singleTop"

    Intent intent= new Intent(context, YourActivity.class);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
    

提交回复
热议问题