aidl 传递bundle参数,bundle 中又包含 Parcel 类,在调用bundle.getParcelable( key)时会有如下log报错,
此时需要在调用bundle 获取 Parcel 类的前调用
bundle.setClassLoader(类对象.class.getClassLoader());
================
2023-04-21 11:05:18.202 3597-3597 Parcel com.android.demo.lileidemo E Class not found when unmarshalling: com.li..api.DialogRequestBean
java.lang.ClassNotFoundException: com.li..api.DialogRequestBean
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:454)
at android.os.Parcel.readParcelableCreator(Parcel.java:3338)
at android.os.Parcel.readParcelable(Parcel.java:3272)
at android.os.Parcel.readValue(Parcel.java:3174)
at android.os.Parcel.readArrayMapInternal(Parcel.java:3567)
at android.os.BaseBundle.initializeFromParcelLocked(BaseBundle.java:292)
at android.os.BaseBundle.unparcel(BaseBundle.java:236)
at android.os.BaseBundle.containsKey(BaseBundle.java:516)
at com.android.demo.lileidemo.ui.activity.SimpleTestActivity$1.onNotifyCallback(SimpleTestActivity.java:142)