Answers for "android on back pressed exit app"

0

onbackpressed close the app in android

@override
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 September-23-2021
0

onbackpressed close the app in android

@override
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 September-23-2021

Code answers related to "android on back pressed exit app"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language