[android-developers] Re: How to Clear Activity stack if using same activity multiple times?
check setFlags in Intent class. Also read http://developer.android.com/guide/topics/fundamentals.html#acttask You can clear the stack upto a particular activity, if you want you can also set that your activity A is never kept in stack. HTH On Mar 4, 2:23 am, Sam samm...@gmail.com wrote: So I have an app with Activity A. The layout on the activity is dynamic genearted. So it's possible that on Activity A a user hits a button that goes to A and the new page looks different, then a user clicks another button to go to A again. Now I have 2 Activities in the history stack. A, A, and currently on A. A-A- A ... Is it possible that if a user clicks a button that the whole Activity stack is cleared in a scenario such as this? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to Clear Activity stack if using same activity multiple times?
Thanks for the info, but no of those intent combination I can seem to get to work. Basically if I have, A(1)-A(2)-A(3)-A(4) And when A(4) starts, I want A1-3 to be cleared from the stack. On Mar 3, 4:37 pm, A R amit.r...@gmail.com wrote: check setFlags in Intent class. Also readhttp://developer.android.com/guide/topics/fundamentals.html#acttask You can clear the stack upto a particular activity, if you want you can also set that your activity A is never kept in stack. HTH On Mar 4, 2:23 am, Sam samm...@gmail.com wrote: So I have an app with Activity A. The layout on the activity is dynamic genearted. So it's possible that on Activity A a user hits a button that goes to A and the new page looks different, then a user clicks another button to go to A again. Now I have 2 Activities in the history stack. A, A, and currently on A. A-A- A ... Is it possible that if a user clicks a button that the whole Activity stack is cleared in a scenario such as this? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to Clear Activity stack if using same activity multiple times?
Did you try singleTop, singleTask or singleInstance? In your situation, you may need to maintain an intent stack all by yourself from A1 through A3, and handle the BACK key event respectively http://d.android.com/guide/topics/manifest/activity-element.html#lmode On Mar 3, 11:58 pm, Sam samm...@gmail.com wrote: Thanks for the info, but no of those intent combination I can seem to get to work. Basically if I have, A(1)-A(2)-A(3)-A(4) And when A(4) starts, I want A1-3 to be cleared from the stack. On Mar 3, 4:37 pm, A R amit.r...@gmail.com wrote: check setFlags in Intent class. Also readhttp://developer.android.com/guide/topics/fundamentals.html#acttask You can clear the stack upto a particular activity, if you want you can also set that your activity A is never kept in stack. HTH On Mar 4, 2:23 am, Sam samm...@gmail.com wrote: So I have an app with Activity A. The layout on the activity is dynamic genearted. So it's possible that on Activity A a user hits a button that goes to A and the new page looks different, then a user clicks another button to go to A again. Now I have 2 Activities in the history stack. A, A, and currently on A. A-A- A ... Is it possible that if a user clicks a button that the whole Activity stack is cleared in a scenario such as this? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to Clear Activity stack if using same activity multiple times?
I ended up following someones suggestion of using an Activity stack to handle things similiar to your intent stack to manage the 'Back' key event thanks. On Mar 3, 6:10 pm, Bo wang.b.fr...@gmail.com wrote: Did you try singleTop, singleTask or singleInstance? In your situation, you may need to maintain an intent stack all by yourself from A1 through A3, and handle the BACK key event respectively http://d.android.com/guide/topics/manifest/activity-element.html#lmode On Mar 3, 11:58 pm, Sam samm...@gmail.com wrote: Thanks for the info, but no of those intent combination I can seem to get to work. Basically if I have, A(1)-A(2)-A(3)-A(4) And when A(4) starts, I want A1-3 to be cleared from the stack. On Mar 3, 4:37 pm, A R amit.r...@gmail.com wrote: check setFlags in Intent class. Also readhttp://developer.android.com/guide/topics/fundamentals.html#acttask You can clear the stack upto a particular activity, if you want you can also set that your activity A is never kept in stack. HTH On Mar 4, 2:23 am, Sam samm...@gmail.com wrote: So I have an app with Activity A. The layout on the activity is dynamic genearted. So it's possible that on Activity A a user hits a button that goes to A and the new page looks different, then a user clicks another button to go to A again. Now I have 2 Activities in the history stack. A, A, and currently on A. A-A- A ... Is it possible that if a user clicks a button that the whole Activity stack is cleared in a scenario such as this? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en