I have android listpopupwindow installed and working in my android app.
I wish to dismiss the popuplist when I click on (and choose) an item instead of clicking outside.
I tried the dismiss(), and dismiss(); break; method anywhere....
I just want to chose an item in the list and after that the popup to go away...
Thanks, Lou
This code worked for me:
popupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
popupWindow.dismiss();
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With