当我尝试将AutoCompleteTextView与RecyclerView一起使用时,我在测试时遇到此异常。
注意:弹出窗口显示在AutoCompleteTextView中,但是当我连续移动到即将到来的textview并尝试添加文本时,很少发生此异常。
FATAL EXCEPTION: main
Process: com.app.test, PID: 10445
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.PopupWindow$PopupDecorView.setFitsSystemWindows(boolean)' on a null object reference
at android.widget.PopupWindow.invokePopup(PopupWindow.java:1254)
at android.widget.PopupWindow.showAsDropDown(PopupWindow.java:1110)
at android.widget.ListPopupWindow.show(ListPopupWindow.java:658)
at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1106)
at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:975)
at android.widget.AutoCompleteTextView.onFilterComplete(AutoCompleteTextView.java:957)
at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:285)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:5529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
不知道如何解决此问题。