我正在尝试从我的主要活动中启动一项新活动。我有:
Button butt = new Button(this);
butt.setText("Colors");
butt.setBackgroundColor(paintCanvas.currentColor());
butt.setOnClickListener(new View.OnClickListener()
{
public void onClick(View view)
{
Intent intent = new Intent(PaintCanvas.this, PaletteActivity.class);
startActivity(intent);
}
});
这将启动新活动,然后立即抛出错误:
10-18 01:41:01.090 28582-28582/com.deekor.fingerpainting E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Parcel: unable to marshal value android.graphics.Path@415c3c68
at android.os.Parcel.writeValue(Parcel.java:1235)
at android.os.Parcel.writeList(Parcel.java:622)
at android.os.Parcel.writeValue(Parcel.java:1195)
at android.os.Parcel.writeMapInternal(Parcel.java:591)
at android.os.Bundle.writeToParcel(Bundle.java:1619)
at android.os.Parcel.writeBundle(Parcel.java:605)
at android.os.Parcel.writeValue(Parcel.java:1170)
at android.os.Parcel.writeSparseArray(Parcel.java:662)
at android.os.Parcel.writeValue(Parcel.java:1198)
at android.os.Parcel.writeMapInternal(Parcel.java:591)
at android.os.Bundle.writeToParcel(Bundle.java:1619)
at android.os.Parcel.writeBundle(Parcel.java:605)
at android.os.Parcel.writeValue(Parcel.java:1170)
at android.os.Parcel.writeMapInternal(Parcel.java:591)
at android.os.Bundle.writeToParcel(Bundle.java:1619)
at android.os.Parcel.writeBundle(Parcel.java:605)
at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:2078)
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:2874)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
怎么了?我的观点使用路径,但为什么这会影响我陈述一项新活动?