Недавно я получил Xoom, и сейчас я работаю над улучшением своих приложений для планшетов HoneyComb.
Все хорошо, и моя последняя проблема касается ListView с FastScroll в TabActavity.
this.setListAdapter(mIndexAdapter);
ListView lv = getListView();
lv.setTextFilterEnabled(true);
//lv.setFastScrollEnabled(true);
Этот код отлично работает на всех телефонах уже 2 года, и теперь у меня проблема с setFastScrollEnabled!
Как вы можете видеть из моего фрагмента, мне пришлось удалить эту строку или я получил это исключение (см. Ниже)
Есть идеи, в чем проблема? Единственный обходной путь, который я нашел, был:
if(android.os.Build.VERSION.SDK_INT<11)
lv.setFastScrollEnabled(true);
Я могу опубликовать свой адаптер, но я действительно не думаю, что это связано.
06-13 13:24:50.520: INFO/ActivityManager(151): Starting: Intent { cmp=tof.cv.mpp/tof.cv.ui.BETrainsTabActivity } from pid 2327
06-13 13:24:50.620: DEBUG/dalvikvm(2327): GC_CONCURRENT freed 203K, 5% free 7383K/7751K, paused 2ms+3ms
06-13 13:24:50.700: DEBUG/AndroidRuntime(2327): Shutting down VM
06-13 13:24:50.700: WARN/dalvikvm(2327): threadid=1: thread exiting with uncaught exception (group=0x40110760)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): FATAL EXCEPTION: main
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): java.lang.NullPointerException
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.FastScroller.getThumbPositionForListPosition(FastScroller.java:612)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.FastScroller.onScroll(FastScroller.java:421)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.AbsListView.invokeOnItemScrollListener(AbsListView.java:1252)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.ListView.layoutChildren(ListView.java:1689)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.AbsListView.onLayout(AbsListView.java:1800)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.View.layout(View.java:9581)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.ViewGroup.layout(ViewGroup.java:3877)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1542)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1403)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.LinearLayout.onLayout(LinearLayout.java:1314)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.View.layout(View.java:9581)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.ViewGroup.layout(ViewGroup.java:3877)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.FrameLayout.onLayout(FrameLayout.java:400)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.View.layout(View.java:9581)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.ViewGroup.layout(ViewGroup.java:3877)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1542)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1403)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.LinearLayout.onLayout(LinearLayout.java:1314)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.View.layout(View.java:9581)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.ViewGroup.layout(ViewGroup.java:3877)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.FrameLayout.onLayout(FrameLayout.java:400)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.View.layout(View.java:9581)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.ViewGroup.layout(ViewGroup.java:3877)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.FrameLayout.onLayout(FrameLayout.java:400)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.View.layout(View.java:9581)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.ViewGroup.layout(ViewGroup.java:3877)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1542)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1403)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.LinearLayout.onLayout(LinearLayout.java:1314)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.View.layout(View.java:9581)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.ViewGroup.layout(ViewGroup.java:3877)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.FrameLayout.onLayout(FrameLayout.java:400)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.View.layout(View.java:9581)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.ViewGroup.layout(ViewGroup.java:3877)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.FrameLayout.onLayout(FrameLayout.java:400)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.View.layout(View.java:9581)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.ViewGroup.layout(ViewGroup.java:3877)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1542)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1403)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.LinearLayout.onLayout(LinearLayout.java:1314)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.View.layout(View.java:9581)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.ViewGroup.layout(ViewGroup.java:3877)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.widget.FrameLayout.onLayout(FrameLayout.java:400)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.View.layout(View.java:9581)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.ViewGroup.layout(ViewGroup.java:3877)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.ViewRoot.performTraversals(ViewRoot.java:1253)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.view.ViewRoot.handleMessage(ViewRoot.java:2003)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.os.Handler.dispatchMessage(Handler.java:99)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.os.Looper.loop(Looper.java:132)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at android.app.ActivityThread.main(ActivityThread.java:4025)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at java.lang.reflect.Method.invokeNative(Native Method)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at java.lang.reflect.Method.invoke(Method.java:491)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
06-13 13:24:50.700: ERROR/AndroidRuntime(2327): at dalvik.system.NativeStart.main(Native Method)
06-13 13:24:50.710: WARN/ActivityManager(151): Force finishing activity tof.cv.mpp/tof.cv.ui.BETrainsTabActivity