应用程序没有启动默认的受限用户帐户 [英] App not launching as default in restricted user account

查看:326
本文介绍了应用程序没有启动默认的受限用户帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Android应用程序上刚刚更新到5.0.2(感谢谷歌的慷慨)平板电脑上运行。它被更新(4.4)之前,它是有同样的问题。所以它不是具体到棒棒糖。

I have an android app running on a tablet that has just been updated to 5.0.2 (Thanks to the generosity of google). Before it was updated (4.4) it was having the same issue. So it's not specific to lollipop.

我运行管理员用户帐户和受限用户帐户的应用程序,具有权限只运行该应用程序。

I run the app on the admin user account and on a restricted user account, with permissions only to run this app.

我在意图过滤器 MainActivity

<intent-filter>
    <action android:name="android.intent.action.BOOT_COMPLETED"/>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.HOME"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

当我运行管理用户的应用程序,它与应用程序启动。当我尝试从应用程序导航,它给我打开主页,应用程序或平板电脑的主页,与选择一次,还是永远的选项。这工作。

When I run the app on the admin user, it launches with the app. When I try to navigate from the app, it gives me the option to open the home page as the app or as the tablet homepage, with options once, or always. This works.

但是当我运行在受限用户帐户的应用程序,它永远不会与应用程序启动并没有选项(显然,因为我已经限制它),将其设置为默认值。

However when I run the app in the restricted user account, it never launches with the app and there's no option to (obviously, as I've restricted it) to set it as the default.

我已经尝试设置应用程序在管理员帐户总是推出,都没有区别。有没有办法超过走到这一步?我想preFER一个解决方案,适用于4.3或4.4,而不是仅仅棒棒糖。

I have tried setting the app to launch always in the admin account, makes no difference. Is there a way to over come this? I would prefer a solution that is applicable to 4.3 or 4.4 as opposed to just lollipop.

感谢。

推荐答案

我解决它。

我去受限用户帐户,并清除了默认设置为主页。该选项当时presented使用的应用程序为默认值,总是或一次,像admin用户。

I went to the restricted user account and cleared the default settings for the home page. The option was then presented to use the app as default, always or once, like for the admin user.

然后我固定 onBack pressed 事件。

@Override
public void onBackPressed() {
    startActivity(new Intent(this, MainActivity.class));
}

所以,用户只能在应用程序和设置之间进行切换,除非他们要清除的默认设置。

So the user can only navigate between the app and the settings, unless they want to clear the default settings.

这能很好地创建一个设备除了我需要从卸载应用程序绕过用户,将只对指定的应用程序工作,进行设备控制..。即使用户能够在用户使用的设备的任何其他功能改变默认,受限制的用户设置prevent

This works well to create a device that will only work for specified apps, for device controls.. except I need to circumvent the user from uninstalling the app. Even though the user is able to change the default, the restricted user settings prevent the user from using any other features of the device.

所以,现在要弄清楚如何prevent从卸载应用程序,默认的用户。

So now to figure out how to prevent the user from uninstalling the app and the default..

这篇关于应用程序没有启动默认的受限用户帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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