This won't work. Android controls the creation of activities. Android provides callbacks such as 'onCreate' (and 'onDestroy', etc.) that inform the application developer of the lifetime management of his/her activity.
In anser to the original question from Noam: go to http://developer.android.com/guide/topics/fundamentals.html and read up on the "Launch Modes" section. You'll get the info you need from there. On Apr 9, 7:15 pm, Roman <roman.baumgaert...@t-mobile.com> wrote: > Noam, > > Try to use the singleton pattern in your application. If you have > already an instance created and try to create another one, then you > would not be able to do this because of the singleton pattern. > > Sr. SW Engineer > Roman Baumgaertner > > ·T· · ·Mobile· stick together > The views, opinions and statements in this email are those of the > author solely in their individual capacity, and do not necessarily > represent those of T-Mobile USA, Inc. > > On Apr 9, 2:39 pm, Noam <noam.ha...@gmail.com> wrote: > > > > > Hello, > > Is there a way to prevent the user of opening more than one instance > > of my application? > > > For example: > > User clicks on App and opens it. > > The user clicks on the home button. (the app is still running in the > > background) > > The user clicks on (not the menu button, but the button above it in > > the homescreen), and then opens the application again. > > Does it open the same instance, or does it create another one? > > If it does create another one, how can I prevent it from creating > > another one, and just opening the existing instance? > > > Thanks, > > Noam.- 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---