【发布时间】:2015-05-08 04:05:37
【问题描述】:
我正在尝试将我的动态壁纸放到亚马逊应用商店(此动态壁纸已经在 Google Play 商店上发布),但是,当我在亚马逊开发者网站上上传相同的 APK 进行测试时,它会报告以下异常
03-06 06:00:50.741 7598 7598 E AndroidRuntime: 致命异常: main 03-06 06:00:50.741 7598 7598 E AndroidRuntime: java.lang.RuntimeException: 无法启动活动 ComponentInfo{com.rrapps.heavensdoor/com.rrapps.heavensdoor.PreviewActivity}: android.content.ActivityNotFoundException: 找不到活动处理 act=android.service.wallpaper.CHANGE_LIVE_WALLPAPER(有附加功能) 在 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2229) 在 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2283) 在 android.app.ActivityThread.access$600(ActivityThread.java:148) 在 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244) 在 android.os.Handler.dispatchMessage(Handler.java:99) 在 android.os.Looper.loop(Looper.java:151) 在 android.app.ActivityThread.main(ActivityThread.java:5204) 在 java.lang.reflect.Method.invokeNative(Native Method) 在 java.lang.reflect.Method.invoke(Method.java:511) 在 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 在 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 在 dalvik.system.NativeStart.main(本机方法) 原因:android.content.ActivityNotFoundException:没有找到处理 act=android.service.wallpaper.CHANGE_LIVE_WALLPAPER 的活动(有附加功能) 在 android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1627) 在 android.app.Instrumentation.execStartActivity(Instrumentation.java:1417) 在 android.app.Activity.startActivityForResult(Activity.java:3424) 在 android.app.Activity.startActivityForResult(Activity.java:3385) 在 com.rrapps.heavensdoor.PreviewActivity.onCreate(未知来源) 在 android.app.Activity.performCreate(Activity.java:5170) 在 android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) 在 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2182)
以下是我设置壁纸的代码
if (Build.VERSION.SDK_INT >= 16) {
/*
* Open live wallpaper preview (API Level 16 or greater).
*/
intent.setAction(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
String pkg = MyWallpaperService.class.getPackage().getName();
String cls = MyWallpaperService.class.getCanonicalName();
intent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
new ComponentName(pkg, cls));
} else {
/*
* Open live wallpaper picker (API Level 15 or lower).
*
* Display a quick little message (toast) with instructions.
*/
intent.setAction(WallpaperManager.ACTION_LIVE_WALLPAPER_CHOOSER);
Resources res = getResources();
String hint = res.getString(R.string.picker_toast_prefix)
+ res.getString(R.string.lwp_name)
+ res.getString(R.string.picker_toast_suffix);
Toast toast = Toast.makeText(this, hint, Toast.LENGTH_LONG);
toast.show();
}
startActivityForResult(intent, 0);
我不确定问题是什么。任何帮助表示赞赏。
【问题讨论】:
-
这肯定会崩溃,因为 amazon fire os 不支持动态壁纸。
标签: android live-wallpaper amazon-appstore