Please explain the difference between FLAG_ACTIVITY_CLEAR_TASK and FLAG_ACTIVITY_CLEAR_TOP?
Submitted by: Muhammad☛ FLAG_ACTIVITY_CLEAR_TASK is used to clear all the activities from the task including any existing instances of the class invoked. The Activity launched by intent becomes the new root of the otherwise empty task list. This flag has to be used in conjunction with FLAG_ ACTIVITY_NEW_TASK.
☛ FLAG_ACTIVITY_CLEAR_TOP on the other hand, if set and if an old instance of this Activity exists in the task list then barring that all the other activities are removed and that old activity becomes the root of the task list. Else if there's no instance of that activity then a new instance of it is made the root of the task list. Using FLAG_ACTIVITY_NEW_TASK in conjunction is a good practice, though not necessary.
Submitted by: Muhammad
☛ FLAG_ACTIVITY_CLEAR_TOP on the other hand, if set and if an old instance of this Activity exists in the task list then barring that all the other activities are removed and that old activity becomes the root of the task list. Else if there's no instance of that activity then a new instance of it is made the root of the task list. Using FLAG_ACTIVITY_NEW_TASK in conjunction is a good practice, though not necessary.
Submitted by: Muhammad
Read Online Android Developer Job Interview Questions And Answers
Top Android Developer Questions
☺ | Explain me what is Context? |
☺ | Explain me what is the Android Application Architecture? |
☺ | Explain me scenario in which only onDestroy is called for an activity without onPause() and onStop()? |
☺ | Explain me how does the activity respond when the user rotates the screen? |
☺ | What are content providers? |
Top Mobile Technologies Categories
☺ | Android Interview Questions. |
☺ | Wireless Communication Interview Questions. |
☺ | 3G Interview Questions. |
☺ | iPhone Interview Questions. |
☺ | Mobile App Architect Interview Questions. |