ActionBarSherlock icon indicating copy to clipboard operation
ActionBarSherlock copied to clipboard

SearchView crash

Open toadzky opened this issue 11 years ago • 6 comments

I found a weird bug that I can't really trace by myself. My activity has a ViewPager with a couple of actions in the Action Bar. If you click the refresh action and try to change pages in the ViewPager, you get a NullPointerException from android.widget.PopupWindow$1.onScrollChanged

The reason I think it's the SearchView is that right before the crash, I get this in my logcat:

Could not find class 'com.actionbarsherlock.widget.SearchView$5', referenced from method com.actionbarsherlock.widget.SearchView.<init>

This is happening on Froyo and Gingerbread, but not ICS or JB.

Here is the complete stack trace:

12-10 11:56:02.230: ERROR/dalvikvm(2793): Could not find class 'com.actionbarsherlock.widget.SearchView$5', referenced from method com.actionbarsherlock.widget.SearchView.<init>
12-10 11:56:16.280: ERROR/AndroidRuntime(2793): FATAL EXCEPTION: main
        java.lang.NullPointerException
        at android.widget.PopupWindow$1.onScrollChanged(PopupWindow.java:124)
        at android.view.ViewTreeObserver.dispatchOnScrollChanged(ViewTreeObserver.java:607)
        at android.view.ViewRoot.draw(ViewRoot.java:1253)
        at android.view.ViewRoot.performTraversals(ViewRoot.java:1163)
        at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:123)
        at android.app.ActivityThread.main(ActivityThread.java:4627)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:521)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
        at dalvik.system.NativeStart.main(Native Method)

toadzky avatar Dec 10 '12 19:12 toadzky

Looks like a duplicate of #487. Are you using the latest version?

SimonVT avatar Dec 10 '12 19:12 SimonVT

Yep, I'm using 4.2.

If it helps determine if this is a duplicate, my Action Bar has a SearchView, a Refresh button, and a Help button. I have 2 menu layouts, one for phone and one for tablets. The phone version uses an overflow menu so the actions don't cut off the title.

toadzky avatar Dec 10 '12 19:12 toadzky

Add a testcase to the known-bugs project on the dev branch

SimonVT avatar Dec 10 '12 19:12 SimonVT

Same issue here:

02-13 11:02:56.648: E/dalvikvm(22529): Could not find class 'com.actionbarsherlock.widget.SearchView$11', referenced from method com.actionbarsherlock.widget.SearchView.

raphaelfrota avatar Feb 13 '13 15:02 raphaelfrota

Could not find class 'com.actionbarsherlock.widget.SearchView$5', referenced from method com.actionbarsherlock.widget.SearchView.

pykaso avatar Mar 28 '13 21:03 pykaso

"E/dalvikvm(22529): Could not find class" is not a bug, and not related to this issue.

SimonVT avatar Mar 28 '13 22:03 SimonVT