Android的 - 自动启动应用程序,并限制访问其他应用 [英] Android - Autostart app and restrict access to other apps

查看:168
本文介绍了Android的 - 自动启动应用程序,并限制访问其他应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Android开发非常新,我有我正在为孩子们的应用程序。我想应用程序时,该装置启动以自行启动。当应用程序运行时,我希望它prevent访问任何其他画面。禁用家按钮,prevent访问浏览器设置等。

I'm fairly new in Android development and I have an app that I'm working on for kids. I would like the app to start itself when the device starts up. When the app is running, I want it to prevent access to any other screens. Disable home buttons, prevent access to browser, settings etc.

这是可能的吗?我碰到这个链接跌跌撞撞 http://www.androidsnippets.com/autostart-an-应用程序在-启动,但也有少数人认为这不是一个好方法,让活动自动启动。

Is this possible to do? I stumbled across this link http://www.androidsnippets.com/autostart-an-application-at-bootup, but a few people think it's not a good approach to allow activities to start automatically.

感谢您: - )

推荐答案

听起来像是你需要自己的发射器,因为只有发射器可以在$不必要的屏幕和Home按钮将被封杀与你的发射器,P $ pvent访问< BR>
这也将解决启动的问题。结果

Sounds like you need your own launcher, because only launcher can prevent access to unnecessary screens and Home button will be "blocked" with your launcher.
It will also solve the "start-up" problem.

所有你需要做的就是声明活动 AndroidManifest 是这样的:

All you need to do is to declare Activity in your AndroidManifest like this:

<activity
android:name="your.package.ActivityName
android:launchMode="singleTask">
<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>

激活你的创造力,并建立启动您的需求。结果
祝你好运!

Activate your creativity, and build launcher for your needs.
Good luck!

这篇关于Android的 - 自动启动应用程序,并限制访问其他应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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