墙纸设置的Android权限拒绝启动意图 [英] Android Permission Denial starting Intent for Wallpaper Settings
问题描述
不幸的是,当我尝试运行墙纸时,收到一条错误消息,提示Permission Denial starting Intent
,并且要求android.permission.BIND_WALLPAPER
,但我似乎无法弄清原因.我的清单如下所示:
Unfortunately when I try to run my wallpaper I get an error message saying Permission Denial starting Intent
and requires android.permission.BIND_WALLPAPER
but I can't seem to figure out why. My manifest looks like the following:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.package">
<uses-feature android:name="android.software.live_wallpaper" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<application
android:exported="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:permission="android.permission.BIND_WALLPAPER">
<service
android:name="WallpaperService"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:permission="android.permission.BIND_WALLPAPER">
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/livewallpaper" />
</service>
<activity
android:name=".WallpaperSetClass"
android:exported="true"
android:permission="android.permission.BIND_WALLPAPER"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
如果通过手机的动态壁纸部分设置动态壁纸,则动态壁纸可以完美运行,但是我也希望有一个设置区域,以便能够在我无法打开的位置进行打开. 目前,我的设置类基本上是空的,只包含一个onCreate函数和一个带有按钮的布局.
The live wallpaper does run perfectly if I set it through the live wallpaper part of my phone, but I would like to have a settings area as well to be able to open in which I can't. At the moment my settings class is basically empty containing just an onCreate function and a layout with a button.
有什么我想念的吗?我似乎拥有android:exported
Is there something I'm missing? I seem to have the permissions along with android:exported
推荐答案
原来我有
android:permission="android.permission.BIND_WALLPAPER"
在错误的位置,它应该在服务标签中,并且只能有一个,如果有多个会破坏它.
In the wrong spot, it should be in the service tag, and only have ONE, having multiple will break it.
这篇关于墙纸设置的Android权限拒绝启动意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!