03-23 13:25:01.580: ERROR/AndroidRuntime(3319): Caused by: java.lang.SecurityException: Not allowed to start service Intent { cmp=com.test/.MyWallpaperService } without permission android.permission.BIND_WALLPAPER
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Main"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".MyWallpaperService"
android:permission="android.permission.BIND_WALLPAPER"
android:id="@+id/myWallSer">
<intent-filter>
<action android:name="com.test.MyWallpaperService"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</service>
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Main"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".MyWallpaperService"
android:permission="android.permission.BIND_WALLPAPER"
android:id="@+id/myWallSer">
<intent-filter>
<action android:name="com.test.MyWallpaperService"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</service>
</application>
</manifest>
解决方案 »
- keytool会不会不同的开发者生成相同的密钥
- 关于android短信拦截的问题
- SharedPreferences保存用户名和密码手机重启后被清空
- 关于真机上运行程序,出现INSTALL_FAILED_MISSING_SHARED_LIBRARY
- pad环境下弹窗窗口之间的互相调用过程
- 我想在apk中放入一些配置文件,安装apk时这些文件能安装到指定目录,这个具体怎么搞啊?
- 刚开始学android的 毕业设计要开发个android应用程序 高手指点
- 如何关闭模拟器?以及如何给模拟器发短信?
- Android操作系统如何划分技术模块
- 比二维码大的有哪些码?
- 新手问问,RadioGroup不能findViewById
- 关于NDK
application声明的上面再增加一句:
<uses-permission android:name="android.permission.BIND_WALLPAPER" />
<wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
android:settingsActivity="com.test/.MyWallpaperService "
/>
<wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
android:settingsActivity="com.test/.MyWallpaperService "
/>
是什么意思啊?加在哪?为什么加上这句话就可以了?