は、ここで私は直列化から拡張の私のインターフェイスですjava.io.NotSerializableExceptionながら
InstaListener iListener = new InstaListener() {
@Override
public void onSuccess(String response) {
}
@Override
public void onFailure(int code, String reason) {
}
};
Intent intent = new Intent(activity, Insta.class);
intent.putExtra("email", email);
intent.putExtra("phone", phone);
intent.putExtra("purpose", purpose);
intent.putExtra("amount", amountstr);
intent.putExtra("name", name);
intent.putExtra("env", env);
intent.putExtra("listener", iListener);
activity.startActivity(intent);
ここです私はInstaクラスのリスナーをどのように受け取っていますか?
instaListener = (InstaListener) getIntent().getSerializableExtra("listener");
私は多くの記事を検索しましたが、私はエラーを取得する理由は何も説明しない: java.io.NotSerializableException
任意のヘルプ?あなたがinstamojo.library.InstamojoPay
の内部クラスを持っている例外とスタックトレース
FATAL EXCEPTION: main
Process: instamojo.testapp, PID: 6785
java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = instamojo.library.InstamojoPay$1)
at android.os.Parcel.writeSerializable(Parcel.java:1527)
at android.os.Parcel.writeValue(Parcel.java:1475)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:724)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1408)
at android.os.Bundle.writeToParcel(Bundle.java:1157)
at android.os.Parcel.writeBundle(Parcel.java:764)
at android.content.Intent.writeToParcel(Intent.java:8687)
at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:3271)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1691)
at android.app.Activity.startActivityForResult(Activity.java:4291)
at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:50)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:79)
at android.app.Activity.startActivityForResult(Activity.java:4249)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:859)
at android.app.Activity.startActivity(Activity.java:4603)
at android.app.Activity.startActivity(Activity.java:4563)
at instamojo.library.InstamojoPay.initInstamojo(InstamojoPay.java:61)
at instamojo.library.InstamojoPay.start(InstamojoPay.java:34)
at instamojo.testapp.MainActivity.callInstamojoPay(MainActivity.java:58)
at instamojo.testapp.MainActivity.access$000(MainActivity.java:17)
at instamojo.testapp.MainActivity$1.onClick(MainActivity.java:39)
at android.view.View.performClick(View.java:5669)
at android.view.View$PerformClick.run(View.java:22549)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6290)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.io.NotSerializableException: instamojo.library.InstamojoPay
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1224)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1584)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1549)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1472)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1218)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
at android.os.Parcel.writeSerializable(Parcel.java:1522)
at android.os.Parcel.writeValue(Parcel.java:1475)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:724)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1408)
at android.os.Bundle.writeToParcel(Bundle.java:1157)
at android.os.Parcel.writeBundle(Parcel.java:764)
at android.content.Intent.writeToParcel(Intent.java:8687)
at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:3271)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1691)
at android.app.Activity.startActivityForResult(Activity.java:4291)
at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:50)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:79)
at android.app.Activity.startActivityForResult(Activity.java:4249)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:859)
at android.app.Activity.startActivity(Activity.java:4603)
at android.app.Activity.startActivity(Activity.java:4563)
at instamojo.library.InstamojoPay.initInstamojo(InstamojoPay.java:61)
at instamojo.library.InstamojoPay.start(InstamojoPay.java:34)
at instamojo.testapp.MainActivity.callInstamojoPay(MainActivity.java:58)
at instamojo.testapp.MainActivity.access$000(MainActivity.java:17)
at instamojo.testapp.MainActivity$1.onClick(MainActivity.java:39)
at android.view.View.performClick(View.java:5669)
at android.view.View$PerformClick.run(View.java:22549)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6290)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
あなたの質問に例外とスタックトレース全体を投稿してください。 – EJP
編集と追加の例外とスタックトレース – user1051505