"Exit" button in application developed in App Framework

1

How to create a "Quit" button or have the application close when using Smartphone "back"?

To develop my application I'm using Intel's App Framework .

    
asked by anonymous 26.05.2014 / 20:03

2 answers

3

First, you need to keep in mind how Android works and Google's recommendations on app design.

Android is designed so the user does not worry if an application is open or closed. The operating system itself decides when to terminate an application based on the memory and processing resources that the system currently has. From the moment the user stops using the application, the application enters a queue to be closed in case of need. Android works like this so a user can quickly change between applications.

The finish() method exists. You can create a button that calls this method directly, but what it will have the same effect of using the back button, which is to hide your activity and leave it in "stop" mode (by calling the onStop () method). What actually closes the activity is onDestroy method that should be called by the system.

In short, Android apps do not have and should not have a quit button. Look at the Google Apps (Gmail, hangout, play music, gplus, calendar etc) none of them have a quit button.

    
27.05.2014 / 08:15
0
Intent intent = new Intent(Intent.ACTION_MAIN);
         intent.addCategory(Intent.CATEGORY_HOME);
         intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         startActivity(intent);
    
06.01.2016 / 17:08