Prevent users from closing or minimizing Android app
2 answers
Kiosk mode is what you are looking for! It was introduced in Android 4.2.
To enable kiosk mode, set it to activity_main.xml
:
<intent-filter>
<category android:name="android.intent.category.HOME" />
</intent-filter>
This question is most likely a hoax: Developing a kiosk mode app in android
+6
source to share
I tested the way ... This is done on a fragment, you can test it yourself to do it from an activity.
public void onDestroyView() {
if(condition) {
Intent intent = new Intent(getContext(), MainActivity.class);
startActivity(intent);
}
super.onDestroyView();
}
This is done from Activity B with a snippet on it, and then from the main activity returns to Activity B. In this case, the user cannot close the application
0
source to share