How to exit from application perminently in android
HI am doing one application here i have one exit button when i click
button,that time i need to exit from application..i tried using below code
app is closing but it still running in taslmanager..but when i click exit
button i should close app as well as i should remove from task manager how
its possible..can any one suggest me..thankyou.
public class MainMenu extends Activity {
Button exit;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mainmenu);
exit=(Button)findViewById(R.id.btn1);
exit.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
});
}
}
This blog site is pretty good! How was it made . I view something genuinely interesting about your site so I saved to my bookmarks . You can visit my Exit intent
ReplyDelete