user1118764
user1118764

Reputation: 9845

Permission required to use UsageStatsManager

I'm trying to use UsageStatsManager. I understand that I need to put the following into my Android manifest:

<uses-permission
    android:name="android.permission.PACKAGE_USAGE_STATS"
    tools:ignore="ProtectedPermissions" />

However, Eclipse throws the following error when I try that: The prefix "tools" for attribute "tools:ignore" associated with an element type "uses-permission" is not bound.

How do I declare the permission properly?

Upvotes: 8

Views: 6168

Answers (2)

Erik Minarini
Erik Minarini

Reputation: 4845

In your manifest file, you have to add the tools namespace. You can declare it this way:

xmlns:tools="http://schemas.android.com/tools"

for example in the manifest tag:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">
.
.
.
</manifest>

Upvotes: 39

R. Zag&#243;rski
R. Zag&#243;rski

Reputation: 20268

Add this to your manifest tag:

xmlns:tools="http://schemas.android.com/tools"

Upvotes: 5

Related Questions