Override or disable settings menu

旧巷老猫 提交于 2019-12-28 05:46:05

问题


I'm making an application that should be used in a store that displays product information. I use an Android tablet to provide the customer with some interactive information. The user should not be able to do anything else with the tablet.

So far i managed to disable the back and home button. The application starts when the booting of the device has finished. He can therefore not start any other application when he restarts the device (I was not able to prevent the user from restarting the device).

The problem is, that the customer can open the settings menu and force kill my application.

Is there a way to either disable the settings menu (e.g. by protecting it with a password) or to override it by my application?

I do not plan to add my application to the Android market since it should only run in the stores.


回答1:


I found out how to override the settings menu.

Since the settings menu is opened via an implicit Intent I just need to add the right intent filters my activity:

<intent-filter >
    <action android:name="android.settings.SETTINGS" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter >
    <action android:name="android.settings.WIRELESS_SETTINGS" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

This will let the user chose the settings application he wants to open. If I now set my activity as default, the user can not access the settings menu via the status bar.




回答2:


I'm pretty sure you can't disable the settings menu all together.

What you could do is look into something like removing the status bar (the one at the bottom).

Check out something like: TabletBar Hider. I haven't tested it, and it would also require that you find a way of having your app run this or a way to implement it into your app. If the status bar gets hidden as soon as your app boots - I can't see how one would get into the settings menu.

You could look into this about getting fullscreen (but I don't know if you've allready tried/considered that).



来源:https://stackoverflow.com/questions/8225156/override-or-disable-settings-menu

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!