0
當我通過處理程序發送消息時遇到問題。Android ArrayMap ClassCastException
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Object[]
at android.util.ArrayMap.allocArrays(ArrayMap.java:187)
at android.util.ArrayMap.put(ArrayMap.java:456)
at android.os.BaseBundle.putInt(BaseBundle.java:389)
at com.easou.ecom.mads.statistics.b.b(Unknown Source)
at com.easou.ecom.mads.statistics.b.a(Unknown Source)
at com.easou.ecom.mads.statistics.b.e(Unknown Source)
at com.easou.ecom.mads.AdSwitchLayout.j(Unknown Source)
at com.easou.ecom.mads.AdSwitchLayout.b(Unknown Source)
at com.easou.ecom.mads.AdSwitchLayout$a.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5539)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
誰能幫幫我?非常感謝..
這是我的Java代碼:
try {
Message message = mHandler.obtainMessage(MESSAGE_ACTION_COUNT);
message.arg1 = event;
Bundle bundle = new Bundle();
bundle.putInt(KEY_MESSAGE_ID, id);
bundle.putInt(KEY_MESSAGE_TYPE, type);
bundle.putString(KEY_MESSAGE_PID, publisherId);
message.setData(bundle);
return message;
} catch (Exception e){
return null;
}
我很懷疑這是正在生成異常的代碼,因爲你是默默捕獲所有異常並返回'null'。 (您至少應該記錄任何捕獲的異常。)您是否通過'retrace'運行堆棧跟蹤來解碼混淆的方法名稱? –
@kkk我建議你在調試時禁用你的代碼縮小,以便你確切地知道哪一行發生了錯誤。 –