jjzjj

BadParcelableException

全部标签

android - 解码 parcelable 数组时出现 ClassCastException

我基本上是在尝试在状态之间保存一组位图。我fragment的onSaveInstanceState:publicvoidonSaveInstanceState(BundleoutState){super.onSaveInstanceState(outState);outState.putParcelableArray(SELECTED_IMAGES_ARRAY_BUNDLE,galleryAdapter.getImageBitmaps());}在它的onCreateView中,我这样检索数组:savedInstanceState.setClassLoader(Bitmap.class.

Android BadParcelableException(Parcelable 协议(protocol)需要一个名为 CREATOR 的 Parcelable.Creator 对象)只有签名的 apk

当我从调试运行我的项目时,一切正常。但是,当我使用从AndroidStudio(使用混淆器)生成的签名apk运行它时,在使用getParcelable时出现以下错误:java.lang.RuntimeException:UnabletostartactivityComponentInfo{mypackage.android/mypackage.mobile.android.activities.searchActivity}:android.os.BadParcelableException:ParcelableprotocolrequiresaParcelable.Creatorob

android - "BadParcelableException: ClassNotFoundException when unmarshalling <myclass>"使用以 ClassLoader 作为参数的 Parcel.read 方法时

给定一个自定义类org.example.app.MyClassimplementsParcelable,我想写一个List到一个包裹。我做了编码ListmyclassList=...parcel.writeList(myclassList);每当我尝试用解码类时ListmyclassList=newArrayList();parcel.readList(myclassList,null);有一个"BadParcelableException:ClassNotFoundExceptionwhenunmarshallingorg.example.app.MyClass"异常(excepti

android - "BadParcelableException: ClassNotFoundException when unmarshalling <myclass>"使用以 ClassLoader 作为参数的 Parcel.read 方法时

给定一个自定义类org.example.app.MyClassimplementsParcelable,我想写一个List到一个包裹。我做了编码ListmyclassList=...parcel.writeList(myclassList);每当我尝试用解码类时ListmyclassList=newArrayList();parcel.readList(myclassList,null);有一个"BadParcelableException:ClassNotFoundExceptionwhenunmarshallingorg.example.app.MyClass"异常(excepti

android - BadParcelableException:解码时出现 ClassNotFoundException

我对Serializable和Parcelable很陌生。我很难将此对象的实例从应用程序传递到远程服务:publicclassEventimplementsParcelable,Cloneable{/**DefinesunderwhatBundle'skeyarchitectureeventsarestored*/publicstaticfinalStringBUNDLE_KEY="ZKEvent";/**Defineswhichmessagesarearchitecture'sevents*/publicstaticfinalintMSG_WHAT=0xDEFECABE;/**Def

android - YouTube Android Player API 在新的 YouTube 版本中抛出 "BadParcelableException ClassNotFoundException when unmarshalling: asc"

向YouTubeAndroidPlayerAPI库工程师提交错误:查看android-youtube-api标签在过去一周半的时间里,我注意到这个奇怪的BadParcelableException在我们的应用程序中稳步增加,并将其确定为YouTube在Android上的新版本。如果您的应用程序正在播放youtube视频,将您的应用程序置于后台,强制停止Youtube应用程序,然后再次恢复您的应用程序,则会发生此崩溃。可在Youtube版本12.19.56上重现崩溃。还在较旧的YouTube版本12.05.21上进行了测试,并没有发生崩溃。堆栈跟踪:mainException:Unabl

android - BadParcelableException - BroadcastReceiver Intent 崩溃

这个错误似乎偶尔会发生,这很奇怪。它通常工作正常,但偶尔会爬起来。这是我的代码,它在BroadcastReceiver中:publicvoidonReceive(Contextcontext,Intentintent){MyCustomResponseMsgmessage=newMyCustomResponseMsg((MyMessage)intent.getParcelableExtra(MyMessage.EXTRA_MESSAGE_KEY));//dostuffwiththemessagesetResultCode(Activity.RESULT_OK);}这里是异常(excep

android - BadParcelableException :ClassNotFoundException when unmarshalling: android. support.v4.app.FragmentManagerState

3天前我已经迁移到SDKAndroid27.1.0,并且有一些像这样的崩溃,我不明白为什么。它(目前)出现在Android8和6上。BadParcelableExceptionClassNotFoundExceptionwhenunmarshalling:android.support.v4.app.FragmentManagerStateandroid.support.v4.app.Fragment.setUserVisibleHintandroid.os.Parcel.readParcelableCreator(Parcel.java:2916)android.os.Parcel.

android - 如何(以及在​​哪里)修复 android.os.BadParcelableException : ClassNotFoundException when unmarshalling: RecyclerView$SavedState?

我的android应用程序的生产apk中出现以下异常已有1天了:java.lang.RuntimeException:UnabletostartactivityComponentInfo{com.a.b/com.a.b.c.d.HomeActivity}:android.os.BadParcelableException:ClassNotFoundExceptionwhenunmarshalling:android.support.v7.widget.RecyclerView$SavedStateatandroid.app.ActivityThread.performLaunchAct

android - 谷歌地图代码中的 BadParcelableException

运行稍加修改的Googlemap示例会在Googlemap代码中引发BadParcelableException。LatLng类是parcelable但找不到。谷歌地图代码似乎试图解开未被它包裹的对象。什么情况下的问题?packagecom.example.mapdemo;importcom.google.android.gms.maps.GoogleMap;importcom.google.android.gms.maps.MapView;importcom.google.android.gms.maps.model.LatLng;importcom.google.android.g
12