Android AlertDialog setOnDismissListener for API lower than 17

前端 未结 1 1558
小蘑菇
小蘑菇 2021-02-11 18:21

I created an AlertDialog:

private CharSequence[] _items = { \"item1\", \"item2\", \"item3\", \"item4\",
\"item5\", \"item6\", \"item7\" };

AlertDialog.Builder d         


        
相关标签:
1条回答
  • 2021-02-11 19:08

    The problem is you are using setOnDismissListener of AlertDialog.Builder. This was introduced in Api level 17, setOnDismissListener of AlertDialog itself has been since api level 1.

    AlertDialog alert = daysBuilder.create();
    alert.setOndismissListener(yourdismisslistener);
    alert.show();`
    
    0 讨论(0)
提交回复
热议问题