添加一个数组

    @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); button = (Button) findViewById(R.id.button); button.setOnClickListener(new OnClickListener() { @Override
public void onClick(View v) {
// TODO Auto-generated method stub AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); builder.setTitle("请选择以下城市"); builder.setMultiChoiceItems(R.array.city, new boolean[] { false, false, false },
new OnMultiChoiceClickListener() { @Override
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
// TODO Auto-generated method stub }
}); AlertDialog dialog = builder.create();
dialog.show();
}
});
}
<?xml version="1.0" encoding="utf-8"?>
<resources> <string name="app_name">Android_multiDialog_test</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string> <string-array name="city">
<item>北京</item>
<item>上海</item>
<item>广州</item>
</string-array> </resources>

最新文章

  1. WCF Misconfiguration: Insufficient Audit Failure Handling
  2. &lt;转&gt;linux crontab 定时任务
  3. 怎样写 OpenStack Neutron 的 Plugin (二)
  4. Android:ScaleType设置图片
  5. IMS 相关名词解释
  6. Linux从零到高手的进阶心得(转)
  7. iOS开发的一些奇巧淫技2
  8. Bootstrap 模态框
  9. Office2016 KMS激活
  10. swift 实现拍照 选择相册
  11. bzoj5102: [POI2018]Prawnicy
  12. [转]关于ios 推送功能的终极解决
  13. 初识 数据库及Oracle数据库
  14. [codeforces][Educational Codeforces Round 53 (Rated for Div. 2)D. Berland Fair]
  15. (笔记)ubuntu中取消文件夹或文件等右下解一把锁的标志的方法
  16. C# 序列化(Serialize)与反序列化(Deserialize)
  17. python下爬某个网页的图片
  18. NSLayout​Constraint
  19. 适用于iOS6之后的苹果提供的下拉刷新
  20. .net 特性 Attribute

热门文章

  1. SAP QM 检验批里样品数量的确定
  2. composer入门 一些简单常用的命令介绍
  3. Android 布局阴影实现
  4. asp.net core 3.0获取web应用的根目录
  5. Ansible-playbook之定义变量
  6. Dev 日志 | 如何将 jar 包发布到 Maven 中央仓库
  7. 程序结构设计理论(Android)
  8. 关于js的for in循环,慎用
  9. C# List、Array、Dictionary之间相互转换
  10. 将CocoStudio产生的UI文件导入到项目