您可以将您的应用程序实现为启动器/主屏幕应用程序。
这是我知道通过按下Android 5及更高版本中的主页按钮来阻止用户关闭您的应用程序的唯一方法。
<activity
android:name="com.example.MainActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
一些详细信息:how-to-write-custom-launcher-app-in-android
否则,你将需要自定义ROM
http://android.stackexchange.com/questions/85013/how-to一个植根设备这可能会帮助你-enable-task-locking-in-android-5-0-production-devices – VVB
你可以通过以下链接查看进一步的指导http://www.sureshjoshi.com/mobile/android-kiosk-mode-without-root/。 在Android活动中阻止开启/关闭电源禁用系统对话框。 – Ajay