Exiting an Application Activity


I didn't check this, because normally in android you not exit from the app, android os take the garbage collection for the app.

So here is the code for existing from an activity.


exitButton = (Button)findViewById(R.id.exit_button);
    exitButton.setOnClickListener(
         new Button.OnClickListener() {
              public void onClick (View v){
                   Log.d(TAG, v.toString() + ": Leaving activity...");
                   Runtime.getRuntime().exit(0);
               }
         }
);

Comments

Popular posts from this blog

Fatal: LoadModule: error loading module 'mod_sql_mysql.c'

Regular Expression Route Constraints And Route Names in Laravel 5.4