覆盖或禁用设置菜单 [英] Override or disable settings menu

查看:87
本文介绍了覆盖或禁用设置菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做,应该在显示产品信息的存储中使用的应用程序。我使用Android平板电脑,以向客户提供一些互动的信息。用户不应该能够做任何事情都要用平板电脑。

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.

到目前为止,我设法禁止背部和主页按钮。当装置的完成引导应用程序启动。当他重新启动设备,他可以因此不启动任何其他应用程序(我无法prevent重新启动该设备的用户)。

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?

我不打算给我的应用程序添加到Android市场,因为它只能在商店中运行。

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

推荐答案

我发现了如何覆盖设置菜单。

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.

这篇关于覆盖或禁用设置菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆