本文介绍了Sherlock操作栏无法找到课程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在通过引用来实现带有Sherlock操作栏的searchview。当我运行应用程序时,出现错误,因为找不到类SuggestionsAdapter。我的日志
I am implementing searchview with sherlock actionbar by refering https://stackoverflow.com/a/14085524/992665 but when I run the application I get the error as could not find the class SuggestionsAdapter. My log
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)
推荐答案
经过一段时间的研究,我最终遇到了NullPointerException,然后发现它是abs本身的错误,这要归功于
After working on a while I ended up with the NullPointerException then found out that it was a bug in abs itself, thanks to https://stackoverflow.com/a/16903531/992665
这篇关于Sherlock操作栏无法找到课程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!