You can automatically restart your closed app Activity after a few seconds using the OneShotAlarm approach described at
http://code.google.com/android/samples/ApiDemos/src/com/example/android/apis/app/ using a scheduled app (re)launch. Regards On Jan 8, 2:39 pm, "Evgeny V" <[email protected]> wrote: > Hi All, > > Any ideas how to restart the app from itself? > I'm trying following code but failed with null pointer exception. Where is > my fault? > public void Restart() > { > newIntent.setClassName("mypackage.name", "MyMainClass"); > newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); > app.startActivity(newIntent); > finish();} > > Thanks > > On Tue, Jan 6, 2009 at 5:34 PM, goldfish <[email protected]>wrote: > > > > > I need to restart my application after a user changes some > > preferences. I want to restart my application as if the user hit home > > and relaunched my application. Does anyone know how to do this? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

