Use of PopupWindow and use of PopupWindow
I recently made a project login interface, using a login interface similar to QQ
The main difference is that a drop-down menu is unfamiliar.
Use PopupWindow. Here we mainly record the main process and main code for future viewing.
1. The first is the storage of historical data. I use SQLiteDataBase
2. Mainly record the use of PopupWIndow
The main problems during use are as follows: 1. Click the window to disappear and collapse it
2. The window has a ListView to respond to the Item click event.
Window is unfocusable by default. It cannot obtain the focus and does not seem to be able to receive click events. setTouchInterceptor can receive events and click events are received by the Activity at the next layer. Although the first requirement can be met, but the second one is not sure ....
(It seems that the focus cannot be obtained, so only information can be displayed, and events cannot be accepted, just like floating on top)
You can click the View on the Window to obtain the focus.
Solution:
The window can get the focus. The following two methods are used to achieve requirement 1 (the icon is put in OnDismiss)
Popup. setOutsideTouchable (true );
Popup. setBackgroundDrawable (new BitmapDrawable ());