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();

更多相关文章

  1. Android(安卓)ContextMenu和Listview配合使用
  2. 背景图片颜色渐变
  3. Android(安卓)5.0新特性ToolBar
  4. android 时间戳与日期格式的互相转换 以及 自定义选择器
  5. android 颜色选择类
  6. android颜色对应的xml配置值,颜色表
  7. android 时间戳与日期格式的互相转换 以及 自定义选择器
  8. Android(安卓)7.0调用系统相机返回路径问题
  9. android表格效果--ListView隔行变色

随机推荐

  1. Android读取资源文件夹里的string-array
  2. Android(安卓)Weekly - 第 182 期
  3. RK3288 android7.1.2 android studio 用
  4. android MIME文件类型
  5. android程序入口
  6. Android(安卓)SDK 更新问题
  7. Android获取当前时间的android.text.form
  8. android的ListView点击item使item展开的
  9. 使用Chronometer 间断计时
  10. android ViewPager自动轮播时控制切换速