PopupWindow error: PopupWindow $1. NullPointerEx appears in onScrollChanged

Source: Internet
Author: User

Error 1:

1.onScrollChanged(PopupWindow.java:127607145313351991991504385507849607

This error often occurs in Gingerbread or earlier versions, less than 3.0. Is a system bug

Solution:

Add the following method after new PopupWindow for check. To be compatible with versions earlier than 3.0, this operation is necessary.

  fixPopupWindow( (Build.VERSION.SDK_INT < Field fAnchor = PopupWindow."mAnchor"= PopupWindow."mOnScrollChangedListener" ViewTreeObserver.OnScrollChangedListener originalListener ==  <View> mAnchor = (WeakReference<View> (mAnchor ==  || mAnchor.get() == 

Refer:

Https://github.com/JakeWharton/ActionBarSherlock/issues/752

Https://groups.google.com/forum? Fromgroups = #! Msg/osmeditor4android/RsHYoY6XqlU/-WGSKWm5OMAJ

 

Error 2:

1426262725921881991303687507867625

Solution: Do not call setFocusable (true) when creating a PopupWindow, call setFocusable (true) after showAtLocation, and call setFocusable (false) When dismiss occurs)

Refer:

Http://stackoverflow.com/questions/7768728/popupwindow-crash-on-dispatch-event

Http://www.eoeandroid.com/thread-109193-1-1.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.