Skip to content Skip to sidebar Skip to footer

Unmarshalling Unknown Type Code Exception While Resuming

I have an application in which i got tablayout with two fragments, the app works perfectly fine but when i close app using menu button and use other apps for a while and when i res

Solution 1:

This was due to a bug in SearchView since appcompat v23.2.0.

It is fixed in v23.2.1. Upgrade your support libraries to get rid of the exception.

Solution 2:

I faced the same issue and found the solution to start the app again to stop the crash In your MainActivity Use:

@OverrideprotectedvoidonRestoreInstanceState(Bundle savedInstanceState) {
    try {
        super.onRestoreInstanceState(savedInstanceState);
    }catch (Exception e){
        e.printStackTrace();
        Intent intent=newIntent(this,MainActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);
    }
}

Post a Comment for "Unmarshalling Unknown Type Code Exception While Resuming"