这是我的代码:
public void addAnim()
{
CustomContentCallbacks ccc = new CustomContentCallbacks() {
@Override
public void onShow(boolean fromResume) {
Toast.makeText(Mini.this, "Showing animation", Toast.LENGTH_SHORT).show();
}
@Override
public void onHide() {
}
@Override
public void onScrollProgressChanged(float progress) {
}
@Override
public boolean isScrollingAllowed() {
return false;
}
};
addToCustomContentPage((RelativeLayout) getLayoutInflater().inflate(R.layout.sprite_animation, null), ccc, "Sprite");
}
基本上我是在主屏幕上添加动画。不幸的是,我一直这样:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.MApps.Launcher.MiniUI/com.MApps.Launcher.MiniUI.Mini}: java.lang.RuntimeException: Expected custom content screen to exist
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2666)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6128)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Caused by: java.lang.RuntimeException: Expected custom content screen to exist
at com.lb.launcher.Workspace.addToCustomContentPage(Workspace.java:655)
at com.lb.launcher.Launcher.addToCustomContentPage(Launcher.java:1211)
at com.MApps.Launcher.MiniUI.Mini.addAnim(Mini.java:65)
at com.MApps.Launcher.MiniUI.Mini.onCreate(Mini.java:26)
at android.app.Activity.performCreate(Activity.java:6682)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2619)
... 9 more
我需要帮助添加这个,因为我计划将Web浏览器与它集成。