gpt4 book ai didi

加载程序dalvik.system.PathClassLoader@456e9880中的java.lang.ClassNotFoundException : com. localfotos.MyWallpaperService

转载 作者:行者123 更新时间:2023-12-01 15:49:04 24 4
gpt4 key购买 nike

我真的不明白为什么会出现这个错误

这是我的 Android list :

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.localfotos"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />

<uses-feature android:name="android.software.live_wallpaper" />

<application android:icon="@drawable/icon" android:label="@string/app_name">

<service android:name=".MyWallpaperService"
android:label="@string/app_name"
android:icon="@drawable/icon">

<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data android:name="android.service.wallpaper"
android:resource="@xml/livewallpaper" />

</service>

</application>
</manifest>

和 MyWallpaperService 类:

import android.service.wallpaper.WallpaperService;
import android.view.MotionEvent;
import android.view.SurfaceHolder;

public class MyWallpaperService extends WallpaperService {

@Override
public Engine onCreateEngine() {
return new MyEngine();
}

@Override
public void onCreate() {
super.onCreate();
}

@Override
public void onDestroy() {
super.onDestroy();
}

public class MyEngine extends Engine {

private MyWallpaperPainting painting;

MyEngine() {
SurfaceHolder holder = getSurfaceHolder();
painting = new MyWallpaperPainting(holder,
getApplicationContext());
}

@Override
public void onCreate(SurfaceHolder surfaceHolder) {
super.onCreate(surfaceHolder);
// register listeners and callbacks here
setTouchEventsEnabled(true);
}

@Override
public void onDestroy() {
super.onDestroy();
// remove listeners and callbacks here
painting.stopPainting();
}

@Override
public void onVisibilityChanged(boolean visible) {
if (visible) {
// register listeners and callbacks here
painting.resumePainting();
} else {
// remove listeners and callbacks here
painting.pausePainting();
}
}

@Override
public void onSurfaceChanged(SurfaceHolder holder, int format,
int width, int height) {
super.onSurfaceChanged(holder, format, width, height);
painting.setSurfaceSize(width, height);
}

@Override
public void onSurfaceCreated(SurfaceHolder holder) {
super.onSurfaceCreated(holder);
// start painting
painting.start();
}

@Override
public void onSurfaceDestroyed(SurfaceHolder holder) {
super.onSurfaceDestroyed(holder);
boolean retry = true;
painting.stopPainting();
while (retry) {
try {
painting.join();
retry = false;
} catch (InterruptedException e) {}
}
}

@Override
public void onOffsetsChanged(float xOffset, float yOffset,
float xStep, float yStep, int xPixels, int yPixels) {
}

@Override
public void onTouchEvent(MotionEvent event) {
super.onTouchEvent(event);
painting.doTouchEvent(event);
}

}

}

谢谢!

最佳答案

确保MyWallpaperService 打包在com.localfotos 中。

关于加载程序dalvik.system.PathClassLoader@456e9880中的java.lang.ClassNotFoundException : com. localfotos.MyWallpaperService,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6496047/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com