0

How do I clear the stack without starting another activity? I tried

testIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
           startActivity(testIntent):

But it requires me to start another activity. Is there any other way? Please help.

Smi
  • 13,850
  • 9
  • 56
  • 64
ShineDown
  • 1,881
  • 3
  • 21
  • 29
  • possible duplicate of [Removing an activity from the history stack](http://stackoverflow.com/questions/1898886/removing-an-activity-from-the-history-stack) – Sean Owen Dec 09 '11 at 10:38

2 Answers2

0

Have you seen this post: Removing an activity from the history stack

That may or may not be helpful.

You can add a android:noHistory="true" to your <Activity /> in AndroidManifext.xml or you can use the FLAG_ACTIVITY_NO_HISTORY when calling your activity.

Without knowing exactly why you need this functionality, I can't offer any suggestions on how to implement. Maybe you can find a way to reorganize your app so that you can take advantage of this.

Community
  • 1
  • 1
Tanner Perrien
  • 3,133
  • 1
  • 28
  • 35
0

You can manually keep track of every activity that is running in your application and call finish() on each one of them.

w.donahue
  • 10,790
  • 13
  • 56
  • 78