lifecycle - How to restart android application from within application -


i have requirement restart application when user changes preference. clearing stack doesnt me since doesnt cancel backend service calls. want kill application process itself. using

process.killprocess(process.mypid()); 

and works me kill application. need restart application. means kill process , trigger new process application start fresh once again.

is there way this?

thanks in advance.

this not 1 should attempt outside of testing environment.

that said, 2 ideas:

1) set alarm time in near future , kill process

2) start else (perhaps small native process or shell script) detect death , restart via intent

you try firing off intent start , dying quickly, sounds potential race condition depending on implementation. if grabbed binder fd out of /proc , did evil things in native code, might able fire off intent in such way application crashes on return ioctl...


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -