Filing bug to YouTube Android Player API Library engineers: see android-youtube-api tag
Over the course of the past week and a half, I\'ve noticed t
Use following code in your onCreate:
@Override
public void onCreate(Bundle b) {
if (b != null) {
final ClassLoader contextCl = getClassLoader();
b.setClassLoader(contextCl);
}
super.onCreate(b);
}
The bug is probably due to YouTube library code storing custom Parcelable inside the state Bundle (YouTube library classes are probably obfuscated by Proguard, hence weird names like "asc").
If the suggestion above does not work, follow along the lines of @Fitz's suggestion and drop the state Bundle. Don't try to mess with it in onCreate (that won't work), instead it is best to override onSaveInstanceState to return Bundle.EMPTY if your app is suspended when you have a playback in progress.
Note, that the bug in question is pretty tricky in multiple ways. If you (or YouTube app) store nested Bundles inside each other, those also need to have proper ClassLoader set… Someone should tell Google to get some common sense and just use Thread#getContextClassLoader inside Bundle to fix that problem once and for all.