How to kill an Android activity?

 How to kill an Android activity when leaving it so that it cannot be accessed from the back button?

All you need to do is call finish() method in Activity class like following code snippets.


Intent intent = new Intent(this, NextActivity.class);
startActivity(intent);
finish();



Comments

Popular posts from this blog

Offers on Friday, April 24, 2020

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