package com.test;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class ProgressActivity extends Activity {
private Button button1;
private TextView textView1;
public ProgressDialog dialog = null;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
button1 = (Button) findViewById(R.id.myButton1);
textView1 = (TextView) findViewById(R.id.myTextView1);
button1.setOnClickListener(myShowProgressBar);
}
Button.OnClickListener myShowProgressBar = new Button.OnClickListener() {
public void onClick(View v) {
final CharSequence dialogTitle = getString(R.string.str_dialog_title);
final CharSequence dialogBody = getString(R.string.str_dialog_body);
// 显示Progress对话框
dialog = ProgressDialog.show(ProgressActivity.this, dialogTitle,
dialogBody, true);
textView1.setText(dialogBody);
new Thread() {
public void run() {
try {
/* 在这里写上要背景运行的程序片段 */
/* 为了明显看见效果,以暂停3秒作为示范 */
sleep(3000);
}
catch (Exception e) {
e.printStackTrace();
}
finally {
// 卸载所创建的dialog对象。
dialog.dismiss();
}
}
}.start();
}
};
}
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Android progress前台运算.zip项目安卓应用源码下载Android progress前台运算.zip项目安卓应用源码下载 1.适合学生毕业设计研究参考 2.适合个人学习研究参考 3.适合公司开发项目技术参考
资源推荐
资源详情
资源评论
收起资源包目录
Android progress前台运算.zip (26个子文件)
Android progress前台运算
Android progress前台运算
1_120904013529_1.png 25KB
1-120Z40134430-L.png 17KB
Android progress前台运算
progress后台运算
bin
progress.apk 15KB
classes.dex 4KB
com
test
ProgressActivity$1$1.class 1KB
ProgressActivity.class 1KB
R$layout.class 364B
R$id.class 392B
R$drawable.class 431B
R$attr.class 310B
R.class 461B
R$string.class 550B
ProgressActivity$1.class 1KB
resources.ap_ 11KB
res
drawable-ldpi
icon.png 2KB
drawable-hdpi
icon.png 4KB
values
strings.xml 477B
color.xml 162B
drawable-mdpi
icon.png 3KB
layout
main.xml 748B
assets
default.properties 449B
gen
com
test
R.java 1KB
src
com
test
ProgressActivity.java 1KB
.project 844B
.classpath 280B
AndroidManifest.xml 679B
共 26 条
- 1
资源评论
yxkfw
- 粉丝: 77
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功