Android Backstack Examples?

Can anyone tell me what a real-world example of Intent flags or launch mode is. Please give me only real use of these flags and not an example of Activity A Activity B using a standard intent. Give a real life example like:

In an eCommerce application, a user accessing the screen make payment

again after a successful payment. In such cases, you need a way to redirect the user back to the home screen. This is where intent flags FLAG_ACTIVITY_SINGLE_TOP

and FLAG_ACTIVITY_CLEAR_TOP

. The use case we're looking at today is where there are multiple actions A, B, C, D, E, etc. and the user navigates through these multiple times - A> B> C> D> E. After E we need to go back to B, but remove the entire activity stack so that only A and B remain. This is the real use of FLAG_ACTIVITY_SINGLE_TOP

+ FLAG_ACTIVITY_CLEAR_TOP

.

In which condition:

  • Only Single_Top Launch mode or Single_Top Flag is the best and its real use?
  • Is it best to use only Single_task run mode or New_task flag and use it?
  • Only Single_instance run mode is best and how to use it?
  • Is it best to only use Clear_Top Flag and use it?
+3


source to share





All Articles