Android常见控件— — —AlertDialog
package com.example.uiwidgettest2; import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.*; public class AlertDialogActivity extends Activity{ private ProgressBar progressBar = null;
private Button btn1 = null; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.edittext); progressBar = (ProgressBar)findViewById(R.id.progress_bar);
btn1 = (Button)findViewById(R.id.button1); btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder dialog = new AlertDialog.Builder(AlertDialogActivity.this);
dialog.setTitle("警告框");
dialog.setMessage("内容");
dialog.setCancelable(false);
dialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) { }
});
dialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) { }
});
dialog.show(); }
}); }
Android常见控件— — —AlertDialog的更多相关文章
- Android -- 常见控件的小效果
1,EditText控件 ① 修改光标颜色 自定义drawable 创建cursor.xml文件 <?xml version="1.0" encoding="utf ...
- Android --> 常见控件
1.TextView 主要用于界面上显示一段文本信息 2.Button 用于和用户交互的一个按钮控件 //为Button点击事件注册一个监听器public class Click extends ...
- Android常见控件— — —ProgressDialog
package com.example.uiwidgettest2; import android.app.Activity;import android.app.AlertDialog;import ...
- Android常见控件— — —ProgressBar
ProgressBar用于在界面上显示一个进度条,表示我们的程序正在加载一些数据. <?xml version="1.0" encoding="utf-8" ...
- Android常见控件— — —EditText
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android=" ...
- Android常见控件— — —Button
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android=&qu ...
- Android常见控件— — —TextView
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android=&qu ...
- Android 基本控件相关知识整理
Android应用开发的一项重要内容就是界面开发.对于用户来说,不管APP包含的逻辑多么复杂,功能多么强大,如果没有提供友好的图形交互界面,将很难吸引最终用户.作为一个程序员如何才能开发出友好的图形界 ...
- Github上star数超1000的Android列表控件
Android开发中,列表估计是最最常使用到的控件之一了.列表相关的交互如下拉刷新,上拉更多,滑动菜单,拖动排序,滑动菜单,sticky header分组,FAB等等都是十分常见的体验.Github中 ...
随机推荐
- Dynamics AX 2012 R2 客制化RDP报表参数对话框
当我们在使用RDP报表时,AX会根据Data Contract,自动生成报表参数对话框上的字段控件.一般情况下,该对话框能够满足我们的需求,但是如果有较为复杂或特殊的需求,就要我们对该对话框进行客制化 ...
- LeetCode----8. String to Integer (atoi)(Java)
package myAtoi8; /* * Implement atoi to convert a string to an integer. Hint: Carefully consider all ...
- POJ 2420:A Star not a Tree?
原文链接:https://www.dreamwings.cn/poj2420/2838.html A Star not a Tree? Time Limit: 1000MS Memory Limi ...
- Tsung安装与使用
Tsung安装与使用 Tsung安装与使用的详细说明,包括测试场景的脚本配置说明 Ray 2013/11/11 目录 安装tsung Tsung运行环境安装... Tsung安装... 使用Tsu ...
- 2016年12月25日 星期日 --出埃及记 Exodus 21:20
2016年12月25日 星期日 --出埃及记 Exodus 21:20 "If a man beats his male or female slave with a rod and the ...
- 。Java注意事项
- struts的hello world小试
struts的hello world小试 前面jdk的安装和配置,tomcat的安装和配置以及java ide的安装和配置就不写了. 在项目中使用流程 创建一个Web项目 导如struts 2.0.1 ...
- C语言位操作(转)
http://www.cnblogs.com/cpoint/category/524132.html
- Eclipse 修改API
真机调试时报错,提示application api 21,device api 10 Automatic Target Mode: Unable to detect device compatibil ...
- zoj3228Searching the String(ac自动机)
链接 这个题把病毒分为了两种,一种包含可以覆盖,另一种不可以,需要分别求出包含他们的个数,可以把两种都建在一颗tire树上,在最后求得时候判断一下当前节点是属于哪种字符串,如果是不包含的需要判断一下p ...