Dialog does not appear

后端 未结 5 2068
鱼传尺愫
鱼传尺愫 2021-01-12 01:19

I use following code:

public class Settings extends Activity implements OnClickListener {

    private Activity activity;
    private AlertDialog.Builder bui         


        
5条回答
  •  天命终不由人
    2021-01-12 02:21

    The reason it is not showing is that .show() was not called on the AlertDialog

    @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            switch (v.getId()) {
            case R.id.bAdd:
                AlertDialog dialog = builder.create();
                dialog.show();
                break;
            }
    
        }
    

提交回复
热议问题