Sherlock动作栏无法找到课程

时间:2013-12-30 07:51:08

标签: android actionbarsherlock searchview

我通过引用https://stackoverflow.com/a/14085524/992665使用sherlock操作栏实现searchview但是当我运行应用程序时,我得到错误,因为找不到类Suggestions Adapter。我的日志

12-30 13:13:39.929: E/dalvikvm(7286): Could not find class 'com.actionbarsherlock.widget.SuggestionsAdapter', referenced from method com.actionbarsherlock.widget.SearchView.updateSearchAutoComplete
12-30 13:13:39.932: E/dalvikvm(7286): Could not find class 'com.actionbarsherlock.widget.SuggestionsAdapter', referenced from method com.actionbarsherlock.widget.SearchView.setQueryRefinementEnabled
12-30 13:13:39.935: E/dalvikvm(7286): Could not find class 'com.actionbarsherlock.widget.SuggestionsAdapter', referenced from method com.actionbarsherlock.widget.SearchView$3.run
12-30 13:13:39.957: E/AndroidRuntime(7286): FATAL EXCEPTION: main
12-30 13:13:39.957: E/AndroidRuntime(7286): java.lang.NullPointerException
12-30 13:13:39.957: E/AndroidRuntime(7286):     at com.example.sherlockdemo.MainActivity.onCreateOptionsMenu(MainActivity.java:43)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at com.actionbarsherlock.app.SherlockActivity.onCreatePanelMenu(SherlockActivity.java:184)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at com.actionbarsherlock.ActionBarSherlock.callbackCreateOptionsMenu(ActionBarSherlock.java:560)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at com.actionbarsherlock.internal.ActionBarSherlockNative.dispatchCreateOptionsMenu(ActionBarSherlockNative.java:64)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at com.actionbarsherlock.app.SherlockActivity.onCreateOptionsMenu(SherlockActivity.java:149)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at android.app.Activity.onCreatePanelMenu(Activity.java:2508)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:411)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at com.android.internal.policy.impl.PhoneWindow.doInvalidatePanelMenu(PhoneWindow.java:784)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:205)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:776)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at android.view.Choreographer.doCallbacks(Choreographer.java:579)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at android.view.Choreographer.doFrame(Choreographer.java:547)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:762)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at android.os.Handler.handleCallback(Handler.java:725)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at android.os.Handler.dispatchMessage(Handler.java:92)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at android.os.Looper.loop(Looper.java:153)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at android.app.ActivityThread.main(ActivityThread.java:5297)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at java.lang.reflect.Method.invokeNative(Native Method)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at java.lang.reflect.Method.invoke(Method.java:511)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
12-30 13:13:39.957: E/AndroidRuntime(7286):     at dalvik.system.NativeStart.main(Native Method)

1 个答案:

答案 0 :(得分:0)

经过一段时间我最终得到了NullPointerException,然后发现它本身就是abs中的一个错误,感谢https://stackoverflow.com/a/16903531/992665