No 96 · android alertdialog
16lz
2022-04-01
final CharSequence[] items = {"Yellow","Red", "Green", "Blue"}; AlertDialog.Builder builder = new AlertDialog.Builder(SendVioInfo.this); builder.setTitle("选择颜色"); builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show(); }}); AlertDialog alert = builder.create(); alert.show();
更多相关文章
- Android(安卓)ContextMenu和Listview配合使用
- 背景图片颜色渐变
- Android(安卓)5.0新特性ToolBar
- android 时间戳与日期格式的互相转换 以及 自定义选择器
- android 颜色选择类
- android颜色对应的xml配置值,颜色表
- android 时间戳与日期格式的互相转换 以及 自定义选择器
- Android(安卓)7.0调用系统相机返回路径问题
- android表格效果--ListView隔行变色