Answers for "app close directly when back button is pressed android studio"

0

android java back button closeapp

public void onBackPressed(){
Intent a = new Intent(Intent.ACTION_MAIN);
a.addCategory(Intent.CATEGORY_HOME);
a.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(a);
}
Posted by: Guest on November-24-2020

Code answers related to "app close directly when back button is pressed android studio"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language