androidM移植,发现日历崩溃,抓log如下:
02-17 16:41:29.806 4921 4921 D AndroidRuntime: Shutting down VM
02-17 16:41:29.808 4921 4921 E AndroidRuntime: FATAL EXCEPTION: main
02-17 16:41:29.808 4921 4921 E AndroidRuntime: Process: com.android.calendar, PID: 4921
02-17 16:41:29.808 4921 4921 E AndroidRuntime: java.lang.ClassCastException: long[] cannot be cast to int[]
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at com.android.timezonepicker.TimeZoneInfo.getTransitions(TimeZoneInfo.java:202)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at com.android.timezonepicker.TimeZoneInfo.<init>(TimeZoneInfo.java:64)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at com.android.timezonepicker.TimeZoneData.loadTzsInZoneTab(TimeZoneData.java:446)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at com.android.timezonepicker.TimeZoneData.loadTzs(TimeZoneData.java:120)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at com.android.timezonepicker.TimeZoneData.<init>(TimeZoneData.java:80)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at com.android.timezonepicker.TimeZonePickerView.<init>(TimeZonePickerView.java:66)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at com.android.timezonepicker.TimeZonePickerDialog.onCreateView(TimeZonePickerDialog.java:72)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at android.app.Fragment.performCreateView(Fragment.java:2220)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:973)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at android.app.BackStackRecord.run(BackStackRecord.java:793)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1535)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at android.app.FragmentManagerImpl$1.run(FragmentManager.java:482)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
02-17 16:41:29.808 4921 4921 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
02-17 16:41:29.811 3226 3353 W ActivityManager: Force finishing activity com.android.calendar/.CalendarSettingsActivity
TimeZoneInfo.java的202附近代码如下:
private static int[] getTransitions(TimeZone tz, long time)
throws IllegalAccessException, NoSuchFieldException {
Class<?> zoneInfoClass = tz.getClass();
Field mTransitionsField = zoneInfoClass.getDeclaredField("mTransitions");
mTransitionsField.setAccessible(true);
//此处出错
int[] objTransitions = (int[])mTransitionsField.get(tz);
int[] transitions = null;
if (objTransitions.length != 0) {
transitions = new int[NUM_OF_TRANSITIONS];
int numOfTransitions = 0;
for (int i = 0; i < objTransitions.length; ++i) {
if (objTransitions[i] < time) {
continue;
}
transitions[numOfTransitions++] = objTransitions[i];
if (numOfTransitions == NUM_OF_TRANSITIONS) {
break;
}
}
}
return transitions;
}
跪求解决