AlertDialog这个类可以.
如果要自定义弹出框的内容,可以调用setView(layoutID)方法加载自定义xml的id,
如果要自定义弹出框的内容,可以调用setView(layoutID)方法加载自定义xml的id,
解决方案 »
- 怎么用一个webview代替listview显示帖子列表
- 哪位高手帮忙指导下,java.net.UnknownHostException: www.weather.com.cn
- Android系统休眠和定时唤醒讨论
- 有两个android的设备,这两个设备怎么互相发消息或广播
- android菜鸟求一个无线点餐系统中点餐模块的代码
- 求帮助,求指点
- 请问下android平台有没有类似3DMark06的程序apk?
- 请问android在后台监听用户的所有操作 研究过吗
- 如何高速显示高清图片
- WebService异常
- androidUI控件放在Activity中的哪里合适?
- 监听短信失败 急求提示...
ContextMenuInfo menuInfo) {}
实现选择的方法:public boolean onContextItemSelected(MenuItem item){}
然后看一个或者几个书本的例子,这样的话应该也不难。
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LayoutInflater factory = LayoutInflater.from(Alert01.this);
//得到自定义对话框
final View DialogView = factory.inflate(R.layout.dialog01, null);
AlertDialog dialog = new AlertDialog.Builder(Alert01.this)
.setTitle("请选择操作")
.setView(DialogView)
.setPositiveButton("确定",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
;
}
}).setNeutralButton("退出", null).create();
dialog.show();
}
}
.setView(DialogView)这个里面的按钮怎么添加监听器呢?