1
我的應用程序有一個PopupWindow創建一個條目。在該彈出,它利用一個AutoCompleteTextView的 - 但是,當showDropDown()被調用時,下面的異常被拋出:嵌套PopupWindows:異常
android.view.WindowManager$BadTokenException: Unable to add window -- token [email protected] is not valid; is your activity running?
它似乎有與AutoCompleteTextView是一個PopupWindow內(這樣做,因爲之前我把它放在那裏工作),導致兩個PopupWindows存在(嵌套)。
你知道這個解決方法嗎?
請分享您的代碼。如果使用應用程序上下文,也可以嘗試(getApplicationContext())。 – Arslan 2012-02-01 19:08:06
這裏代碼太多了。上下文不涉及這裏。問題似乎是AutoCompleteView需要一個來自Activity的窗口,但是它並沒有得到它,因爲PopupWindow是它的父窗口。 – manmal 2012-02-02 16:30:21