Ok, here are some reasons why you get null pointer exception activity.finish() is an asynchrnous call..so you cant predict when finish will be called. Thinking that finish has been called before your next call to startActivity will always result you a null pointer exception.
Thanks, On Sep 8, 12:57 pm, TreKing <[email protected]> wrote: > On Wed, Sep 8, 2010 at 2:44 PM, OldSkoolMark <[email protected]> wrote: > > My use case is setting UI preferences (e.g. a different layout) in a > > PreferenceActivity. When I return to the main activity's onResume(), I > > check for preference changes and if a new layout is requested, I use > > the code snippet above. > > I would call PreferenceActivity with startActivityForResult, then > onActivityResult of the calling activity check if you need to "reset", then > do what you're doing there instead. > > ------------------------------------------------------------------------------------------------- > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago > transit tracking app for Android-powered devices -- 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

