
protected Dialog onCreateDialog(int ID) { final AlertDialog.Builder dialog = new AlertDialog.Builder(this); dialog.setMessage("Enter Holla message"); EditText hollaMessage = new EditText(this); dialog.setVIEw(hollaMessage); dialog.setCancelable(false); dialog.setPositivebutton("Send",new DialogInterface.OnClickListener() { public voID onClick(DialogInterface dialog,int ID) { List result = new ArrayList(); } }); dialog.setPositivebutton("Cancel",new DialogInterface.OnClickListener() { public voID onClick(DialogInterface dialog,int which) { dismissDialog(0); } }); AlertDialog alert = dialog.create(); return alert;}解决方法 你设置了两次正面按钮..使它setNagativebutton(“取消”….. protected Dialog onCreateDialog(int ID){ final AlertDialog.Builder dialog = new AlertDialog.Builder(this); dialog.setMessage("Enter Holla message"); EditText hollaMessage = new EditText(this); dialog.setVIEw(hollaMessage); dialog.setCancelable(false); dialog.setPositivebutton("Send",int ID) { List result = new ArrayList(); } }); dialog.setNegativebutton("Cancel",int which) { dismissDialog(0); } }); AlertDialog alert = dialog.create(); return alert;} 总结 以上是内存溢出为你收集整理的android – AlertDialog没有显示两个按钮全部内容,希望文章能够帮你解决android – AlertDialog没有显示两个按钮所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)