问题描述
我在我的code这个logcat的一个错误:
I get an error in my code with this logcat:
java.lang.NoClassDefFoundError: android.util.ArrayMap
at it.dd.multiplayerit.MainActivity.<init>(MainActivity.java:88)
at it.dd.multiplayerit.SwipeMainFragment$SectionsPagerAdapter.getItem(SwipeMainFragment.java:200)
at android.support.v4.app.FragmentPagerAdapter.instantiateItem(FragmentPagerAdapter.java:97)
at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:832)
at android.support.v4.view.ViewPager.populate(ViewPager.java:982)
at android.support.v4.view.ViewPager.populate(ViewPager.java:914)
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1436)
at android.view.View.measure(View.java:15284)
at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.onMeasure(CustomViewAbove.java:456)
at android.view.View.measure(View.java:15284)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:665)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:447)
at android.view.View.measure(View.java:15284)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4816)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:15284)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:861)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:602)
at android.view.View.measure(View.java:15284)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4816)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2367)
at android.view.View.measure(View.java:15284)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1867)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1111)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1292)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1009)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4236)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4872)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(Native Method)
我认为这个问题是我创建的autocompletetextview。我映射的阵列来获得阵列的位置,当我型我想要的搜索过程中,单击下拉。
I think that the problem is the autocompletetextview i created. I mapped the array to get the position of array when i click in the dropdown during type what i want search.
目前线88,我有这样的:
At line 88 i have this:
ArrayMap<String, Integer>myArrayMap = new ArrayMap<String, Integer>();
崩溃似乎只与Android 4.1版本。是否有任何不兼容?
The crash seems to be only with android 4.1 version. Is there any incompatibility?
推荐答案
ArrayMap
中引入了API级别19,但它也被发布在兼容性库V4,所以这将是足以改变进口 android.support.v4.util.ArrayMap
而不是 android.util.ArrayMap
ArrayMap
was introduced in Api level 19, but it was also released in the compatibility library v4, so it would be enough to change the import to android.support.v4.util.ArrayMap
instead of android.util.ArrayMap
这篇关于崩溃了Android 4.1与ArrayMap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!