On Fri, Feb 18, 2011 at 7:26 AM, Streets Of Boston <[email protected]>wrote:
> "the original intent might be restored by the system when the activity is > restarted" > This is not my experience. The system restores the intent with which the > activity was called last. > If your activity is singleTop, its onNewIntent(...) is called with the > intent that was used by the call to startActivity that caused your activity > to be restarted. Be sure to call 'setIntent' in your implementation of > onNewIntent and that new intent will be used when the system needs > to restore your activity. > I promise you, what you supply to setIntent() is NEVER remembered across activity instances. You can prove this to yourself by looking at the code. Here is the implementation of setIntent(): http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/app/Activity.java;h=f25c4c385e4f510bec426fbef801243e4c149f69;hb=HEAD#l714 Very simple. If you look through that code (and ActivityThread.java), you will see that the current value in mIntent is never pulled out to remember for the next instance. -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

