Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to quit an application programmatically through button click

Tags:

People also ask

How do I close an app with the button?

To close apps on Android, swipe up from the bottom of the screen and hold until the recent apps menu pops up (if you use gesture navigations). If you use button navigation, tap on the recent apps button. Swipe up to close individual apps or tap the Close all button to close all background apps.

How do I programmatically quit my iOS application?

An iOS app never displays a Close or Quit option. People stop using an app when they switch to another app, return to the Home screen, or put their devices in sleep mode. Never quit an iOS app programmatically.

How do you end an app on Android?

To Close the Application, you can also take "System. exit(0)" 0 is standard or use any exit code.


I want to quit application through button click.

the code for button click is

quitBtn.setOnClickListener(new View.OnClickListener() {         
    @Override
    public void onClick(View paramView) {
        // TODO Auto-generated method stub              
        MainActivity.this.finish();
    }
});

But it require two clicks to exit from the app.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!