我试图为 android live wall paper 运行一些教程示例,但总是出现此错误
09-28 16:13:30.729: E/AndroidRuntime(408): java.lang.RuntimeException: 无法实例化服务 net.markguerra.android.glwallpaperexample.MyWallpaperService: java.lang.ClassNotFoundException: net.markguerra.android.glwallpaperexample。加载程序 dalvik.system.PathClassLoader[/data/app/net.markguerra.android.glwallpaperexample-1.apk] 中的 MyWallpaperService
这是我的清单文件
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.markguerra.android.glwallpaperexample"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<service android:label="@string/service_label" android:name=".MyWallpaperService"
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/myglwallpaper" />
</service>
</application>
<uses-sdk android:minSdkVersion="7" />
</manifest>
我创建的壁纸服务
package net.markguerra.android.glwallpaperexample;
import net.rbgrn.android.glwallpaperservice.*;
// Original code provided by Robert Green
// http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-wallpapers
public class MyWallpaperService extends GLWallpaperService {
public MyWallpaperService() {
super();
}
public Engine onCreateEngine() {
MyEngine engine = new MyEngine();
return engine;
}
class MyEngine extends GLEngine {
MyRenderer renderer;
public MyEngine() {
super();
// handle prefs, other initialization
renderer = new MyRenderer();
setRenderer(renderer);
setRenderMode(RENDERMODE_CONTINUOUSLY);
}
public void onDestroy() {
super.onDestroy();
if (renderer != null) {
renderer.release();
}
renderer = null;
}
}
}
这是我的项目结构
我无法弄清楚它出了什么问题,是什么错误?任何建议都会对我有很大帮助
在堆栈上发现了一些相关的问题,但与动态壁纸无关