Android弹出提示框
来源:互联网 发布:狄克斯特拉算法python 编辑:程序博客网 时间:2024/05/09 01:55
AlertDialog.Builder builder = new Builder(mainActivity);
builder.setTitle("提示");
builder.setMessage("是否退出应用?");
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
System.exit(0); //退出应用
}
});
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss(); //取消
}
});
builder.create();
builder.show();
new AlertDialog.Builder(ListCommonActivity.this).setMessage("获取信息失败,请重新获取。").setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
}).create().show();
在页面中显示图片提示信息
//创建新Toast对象
Toast showImageToast = new Toast(this);
//创建新ImageView对象
ImageView imageView = new ImageView(this);
//从资源中获取图片
imageView.setImageResource(R.drawable.tu_pian );
//设置Toast上的 View--(ImageView)
showImageToast.setView(imageView);
//设置Toast显示时间
showImageToast.setDuration(Toast.LENGTH_LONG );
//显示Toast
showImageToast.show();
- Android 弹出提示框
- android 弹出提示框
- Android弹出提示框
- android 弹出提示框
- Android中的弹出提示框
- Android中的弹出提示框
- Android中的弹出提示框
- android中常用的弹出提示框
- Android 开发之 Toast (弹出提示框)
- android中常用的弹出提示框
- android中常用的弹出提示框
- android中常用的弹出提示框
- android中常用的弹出提示框
- android中常用的弹出提示框
- android中常用的弹出提示框
- android中常用的弹出提示框
- android中常用的弹出提示框
- android editText 弹出错误提示框
- JQuery控制Radio
- 获取某一月工作日
- linux下编译自己的库文件实践
- C# 中 foreach 使用方法
- ORA-14508:specified VALIDATE INTO table not found
- Android弹出提示框
- RadioGroup同时选中两个RadioButton的问题
- MatLab2012b/MatLab2013b 分类器大全(svm,knn,随机森林等)
- 物理分辨率和压缩分辨率
- SOAP 详解
- jquery一些方法
- android C 中调用SHELL脚本
- Java调用SQL Server的存储过程详解
- Javascript Function