首页 > 代码库 > 关于MessageQueue-JNI的错误问题解决

关于MessageQueue-JNI的错误问题解决

11-19 14:46:23.016: E/MessageQueue-JNI(10777): Exception in MessageQueue callback: handleReceiveCallback
11-19 14:46:23.026: E/MessageQueue-JNI(10777): java.lang.IllegalArgumentException: parameter must be a descendant of this view
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.ViewGroup.offsetRectBetweenParentAndChild(ViewGroup.java:4420)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.ViewGroup.offsetDescendantRectToMyCoords(ViewGroup.java:4357)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.FocusFinder$SequentialFocusComparator.getRect(FocusFinder.java:688)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.FocusFinder$SequentialFocusComparator.compare(FocusFinder.java:660)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.FocusFinder$SequentialFocusComparator.compare(FocusFinder.java:641)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at java.util.TimSort.countRunAndMakeAscending(TimSort.java:320)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at java.util.TimSort.sort(TimSort.java:185)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at java.util.TimSort.sort(TimSort.java:169)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at java.util.Arrays.sort(Arrays.java:2038)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at java.util.Collections.sort(Collections.java:1891)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.FocusFinder.findNextInputFocusInRelativeDirection(FocusFinder.java:198)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.FocusFinder.findNextFocus(FocusFinder.java:166)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.FocusFinder.findNextInputFocus(FocusFinder.java:102)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.FocusFinder.findNextFocus(FocusFinder.java:83)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.FocusFinder.findNextFocus(FocusFinder.java:65)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.ViewRootImpl.focusSearch(ViewRootImpl.java:3994)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.ViewRootImpl.clearChildFocus(ViewRootImpl.java:2635)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.ViewGroup.clearChildFocus(ViewGroup.java:863)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.ViewGroup.clearChildFocus(ViewGroup.java:863)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.ViewGroup.clearChildFocus(ViewGroup.java:863)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.ViewGroup.clearChildFocus(ViewGroup.java:863)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.ViewGroup.clearChildFocus(ViewGroup.java:863)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.ViewGroup.clearChildFocus(ViewGroup.java:863)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.ViewGroup.clearChildFocus(ViewGroup.java:863)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.ViewGroup.removeViewInternal(ViewGroup.java:3787)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.ViewGroup.removeViewInternal(ViewGroup.java:3748)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.view.ViewGroup.removeView(ViewGroup.java:3680)
11-19 14:46:23.026: E/MessageQueue-JNI(10777): 	at android.support.v4.view.ViewPager.removeView(ViewPager.java:1321)

这个错误的解决:

ViewPager中调用的方法:

				try {
					myPetAdapter.destroyItem((View) select_pet_mores_viewPager, arg0, null);
					views[arg0] = myPetAdapter.instantiateItem((View) select_pet_mores_viewPager, arg0);
				} catch (Exception e) {
					// TODO: handle exception
					MM.sysout("Exception in MessageQueue callback: handleReceiveCallback");
				}
其中调用了:destroyItem、instantiateItem
加入异常处理就可以了


关于MessageQueue-JNI的错误问题解决