错误的Manifest.xml添加PACKAGE_USAGE_STATS当[Android的棒棒糖] [英] Error in Manifest.xml when adding PACKAGE_USAGE_STATS [Android Lollipop]

查看:2878
本文介绍了错误的Manifest.xml添加PACKAGE_USAGE_STATS当[Android的棒棒糖]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用 android.permission.PACKAGE_USAGE_STATS 我的应用程序。 这里该说的注:此API要求许可android.permission.PACKAGE_USAGE_STATS,这是一个系统级权限,不会授予第三方应用。不过,声明许可暗示有意使用API​​和设备的用户可以通过设置应用程序授予权限。

I am trying to use "android.permission.PACKAGE_USAGE_STATS" in my app. Here it says that NOTE: This API requires the permission android.permission.PACKAGE_USAGE_STATS, which is a system-level permission and will not be granted to third-party apps. However, declaring the permission implies intention to use the API and the user of the device can grant permission through the Settings application.

看来我需要用户明确地给我的应用程序给访问接入使用统计信息的权限。

It seems that I will need the user to explicitly give my app the permission to give access to the access the usage stats.

另外,我用的意图code以下打开屏幕,让用户放弃访问我的应用程序,但我的应用程序是不是在列表中。
    code我用:

In addition, I used the intent code below to open the screen to allow user to give access to my app, but my app is not in the list. Code I used:

Intent intent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS);
startActivity(intent);

在* startActivity(意向)'被触发(或去*设置>安全>与用法访问应用程序),空白屏幕下方弹出,我的应用程序是不是它的一部分。

When *startActivity(intent)' is fired (or going to *Settings>Security>Apps with Usage Access), a blank screen below pops up, my app is not part of it.

底线的问题是 - 如何使用 UsageStatsManager Android中棒棒糖?任何人都尝试过吗?

Bottom line question is -- How to use UsageStatsManager in Android Lollipop? Anyone tried it?

推荐答案

在AndroidManifest.xml中的错误可以通过禁用皮棉错误修复。具体来说

The AndroidManifest.xml error can be fixed by disabling lint errors. Specifically

Security - SignatureorSystemPermissions 

我想以后的设置应用程序会显示您的应用程序。

I guess after that the settings app will show your app.

这篇关于错误的Manifest.xml添加PACKAGE_USAGE_STATS当[Android的棒棒糖]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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