java - How to exit an android app using code? -


i sure question has been asked number of times because read few. client wants me put button app users can click , exit. have read this , found calling finish() it. but, finish closing current running activity right? have lot of activities in case have pass each , every activity's instance , finish them or make every activity singleton pattern.

i got know activity.movetasktoback(true) can home screen. ok, not closing backgrounding process. effective?

which method should use close app completely? of above described or other method/other usage of above methods?

please help.

you can call system.exit(); out of acivities.

    submit=(button)findviewbyid(r.id.submit);              submit.setonclicklistener(new onclicklistener() {                  @override                 public void onclick(view arg0) { android.os.process.killprocess(android.os.process.mypid());                     system.exit(1);                  }             }); 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -