It is perfectly okay to call startActivity() for another instance of yourself, and then finish() of your current activity. Without more information, I can't help much with what is going on, but as far as I know there are no bugs that would cause this. When you do this kind of thing, though, keep in mind:
- Your activity should use the default "multiple" launch mode. The other launch modes will retain your current instance of the activity without starting a new one. - Be careful of any static variables you have around, since you will have multiple instances of the same activity using the same statics. On Apr 14, 4:32 pm, Redhunt <[EMAIL PROTECTED]> wrote: > :( > Because it would not work :( .... > > On Apr 14, 6:21 pm, "Dan U." <[EMAIL PROTECTED]> wrote: > > > That sounds like a poor design. Why not just call setContentView > > again? > > > On Apr 14, 1:23 pm, Redhunt <[EMAIL PROTECTED]> wrote: > > > > I am trying to do the following. The application has several skins, I > > > want the user to be able to change the skins on the fly. The > > > definitions of the skins come from layout files. So a call to > > > setContentView will have to happen on the switch. > > > What I have come up with is to have my activity instantiate a new > > > activity (of the same type as itself) and then "finish" itself. > > > > It works fairly well, but I am encountering some strange problems > > > where values for certain variable are not what I would expect them to > > > be. As if a race condition of some sort is taking place. But I can't > > > find it because the debugger does not pick it up. > > > > Essentially a variable that is set to true on the OnCreate() method of > > > the Activity gets reset to false at some point after the second > > > activity calls its OnCreate() method and before it calls a function > > > that is call after the first draw of a map layer. > > > > Does any of these make sense. Is there a fundamental concept about > > > Activities that I am missing here? > > > > Thanks- Hide quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---