Дано:
MainActivity в нем фрагмент с recyclerview, в адаптере описан onClickListener открывающий новое NewsActivity.
При нажатии кнопки back из нового активити происходит краш.
подозреваю что неправильно задан context при старте активити
pubViewHolder.getPublicationCard().setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent fullPublication = new Intent(v.getContext(), NewsActivity.class);
v.getContext().startActivity(fullPublication);
}
});
Помогите разобраться.
лог:
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: FATAL EXCEPTION: main
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: Process: ru.cl.cl, PID: 29951
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{ru.cl.cl/ru.cl.cl.MainActivity}: java.lang.RuntimeException: Parcel android.os.Parcel@376d28c5: Unmarshalling unknown type code 3080309 at offset 788
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2693)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.ActivityThread.access$900(ActivityThread.java:177)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.os.Looper.loop(Looper.java:145)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5942)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: Caused by: java.lang.RuntimeException: Parcel android.os.Parcel@376d28c5: Unmarshalling unknown type code 3080309 at offset 788
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.os.Parcel.readValue(Parcel.java:2222)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.os.Parcel.readListInternal(Parcel.java:2520)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.os.Parcel.readArrayList(Parcel.java:1836)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.os.Parcel.readValue(Parcel.java:2167)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.os.BaseBundle.unparcel(BaseBundle.java:221)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.os.Bundle.getSparseParcelableArray(Bundle.java:871)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:836)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1082)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1064)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.FragmentManagerImpl.dispatchCreate(FragmentManager.java:1879)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.Activity.onCreate(Activity.java:995)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.support.v4.app.BaseFragmentActivityDonut.onCreate(BaseFragmentActivityDonut.java:39)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:278)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:61)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at ru.cl.cl.MainActivity.onCreate(MainActivity.java:26)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6283)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.ActivityThread.access$900(ActivityThread.java:177)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.os.Looper.loop(Looper.java:145)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5942)
01-12 11:30:50.900 29951-29951/ru.cl.cl E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)