How do these two attributes relate? If I have android:noHistory="true"
, does having android:finishOnTaskLaunch="true"
have any significance/meaning?
Let's say you have three activities in your app: A, B, and C. You start your app and see A, click a button and see B, click a button and see C.
First scenario
Now if you press the Back button on your phone, you will see B.
Second scenario
Let's say that B has android:noHistory="true"
.
Now if you press the Back button on your phone, you will see A. The android:noHistory="true"
attribute removed B from the history (i.e. the activity stack), so you will not see it when you hit the Back button.
Third scenario
Let's say that C has android:finishOnTaskLaunch="true"
.
Now if you press the Home button on your phone and then launch the app again, you will see B. Android ended C when you launched the app again because it has the android:finishOnTaskLaunch="true"
attribute.
finishOnTaskLaunch
would kill the Activity
as you move to another task. But noHistory
would kill the Activity
if you move to another activity in the same task.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With