Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
198 views
in Technique[技术] by (71.8m points)

android - Override or disable settings menu

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...