Android_创建拥有自己adapter的Alertdialog
2012-10-29 23:06
169 查看
源码
packages\apps\Mms\src\com\android\mms\ui\ComposeMessageActivity.java
packages\apps\Mms\src\com\android\mms\ui\ComposeMessageActivity.java
private void showAddAttachmentDialog(final boolean replace) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setIcon(R.drawable.ic_dialog_attach); builder.setTitle(R.string.add_attachment); if (mAttachmentTypeSelectorAdapter == null) { mAttachmentTypeSelectorAdapter = new AttachmentTypeSelectorAdapter( this, AttachmentTypeSelectorAdapter.MODE_WITH_SLIDESHOW); } //builder.setAdapter(adapter,onClickListener),其中OnClickListener对AlertDialog中的每项的点击进行处理 builder.setAdapter(mAttachmentTypeSelectorAdapter, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { addAttachment(mAttachmentTypeSelectorAdapter.buttonToCommand(which), replace); dialog.dismiss(); } }); builder.show(); }
相关文章推荐
- android_创建拥有自己的layout的Alertdialog
- android中,用SimpleAdapter创建有自己布局的listView,以及listView的修改更新notifyDataSetChanged()的使用。
- Android-----SimpleAdapter创建ListView的实例,及值得注意的一些细节问题
- git学习--repo批量创建远端仓库----建立自己的android代码仓库
- Android 通过AlertDialog创建伪菜单
- eclipse创建自己的android版hello world
- android之SimpleAdapter创建和动态添加.删除SimpleAdapter选中项
- 无废话Android之listview入门,自定义的数据适配器、采用layoutInflater打气筒创建一个view对象、常用数据适配器ArrayAdapter、SimpleAdapter、使用ContentProvider(内容提供者)共享数据、短信的备份、插入一条记录到系统短信应用(3)
- Android 创建自己的Camera App
- 【起点】跟我一起创建自己的第一个Android应用——HelloAndroid
- android 自己创建一个注释模板
- Android 创建自己的证书文件,使用signapk.jar为apk以及zip文件签名
- 在Android的Framework中自己创建Exception并使用的方法
- android-继承BaseAdapter--自己定义适配器,getView运行多次的解决方法
- 新建Android项目,会出现两个项目一个是自己创建的项目,另一个是“appcompat_v7”项目,这是怎么回事呢?该怎么解决呢?
- Android--创建对话框AlertDialog
- Android中创建一个使用ListView以及用BaseAdapter进行数据适配的程序
- Android开发之内容提供者——创建自己的ContentProvider(详解)
- 【Android】利用ArrayAdapter/SimpleAdapter创建ListView
- Android开发自己总结的Adapter的一些工具类