Home key press behaviour

前端 未结 8 1560
北恋
北恋 2020-12-03 08:36

While developing a sample android application i have constructed two activities 1)Activity 1 2)Activity 2

Now Activity 2 is the foreground activity whereas Activity

相关标签:
8条回答
  • 2020-12-03 09:12

    The launch mode of your activity can affect the behaviour when it is relaunchd after pressing home. If the first activity was launched as singletask or singleinstance then , its always the first activity that will be resumed.

    If activities are launched using default launch mode, then when the application is restarted, the previous activity will be resumed

    0 讨论(0)
  • 2020-12-03 09:12

    I had a similar problem. It wasn't launching the last open activity but the Launcher Activity. But I had also put

    android:launchMode="singleTask"
    

    in my Launcher Activity in the manifest. Removing that fixed my issue. If you have also put the same thing then try removing it, it might fix for you too.

    0 讨论(0)
提交回复
热议问题