mixer-a
BlogJava
::
首頁
::
新隨筆
::
聯(lián)系
::
聚合
::
管理
posts - 101, comments - 29, trackbacks - 0
常用鏈接
我的隨筆
我的評(píng)論
我的參與
最新評(píng)論
留言簿
給我留言
查看公開留言
查看私人留言
隨筆檔案
(101)
2012年8月 (2)
2012年7月 (13)
2012年6月 (6)
2012年5月 (6)
2012年4月 (26)
2012年3月 (16)
2012年2月 (17)
2012年1月 (15)
我的連接
a
iteye
csdn
www.javady.com
www.javady.com
搜索
最新評(píng)論
1.?re: android開發(fā)我的新浪微博客戶端-登錄頁面UI篇(4.1)[未登錄]
仿真時(shí)提示:No Launcher activity found!
--小龍
2.?re: android開發(fā)我的新浪微博客戶端-登錄頁面UI篇(4.1)[未登錄]
“新建名LoginActivity.java的Activity并且在AndroidManifest.xml中進(jìn)行相應(yīng)配置”請(qǐng)問怎么進(jìn)行配置?因?yàn)樾陆ǖ腖oginActivity.java無法啟動(dòng)仿真。
--小龍
3.?re: JS 時(shí)間處理和格式轉(zhuǎn)換
@Wanlic2008
不用把時(shí)間的年份拿出來單獨(dú)分析
--Wanlic2008
4.?re: JS 時(shí)間處理和格式轉(zhuǎn)換
評(píng)論內(nèi)容較長,點(diǎn)擊標(biāo)題查看
--Wanlic2008
5.?re: Android進(jìn)階2之Http連接GET/POST請(qǐng)求
有用
--許大海
閱讀排行榜
1.?JS 時(shí)間處理和格式轉(zhuǎn)換(41192)
2.?Android進(jìn)階2之Activity之間數(shù)據(jù)交流(onActivityResult的用法)(11506)
3.?[原]Android應(yīng)用程序發(fā)送廣播(sendBroadcast)的過程分析(7305)
4.?[原]Android應(yīng)用程序鍵盤(Keyboard)消息處理機(jī)制分析(4909)
5.?并行計(jì)算框架的Java實(shí)現(xiàn)--系列一(3793)
評(píng)論排行榜
1.?你想不到的壓縮方法:將javascript文件壓縮成PNG圖像存儲(chǔ)(4)
2.?MyEclipse快捷鍵設(shè)置(4)
3.?開發(fā)流程那些事:6天時(shí)間修改1行代碼(3)
4.?JS 時(shí)間處理和格式轉(zhuǎn)換(3)
5.?也談 GET 和 POST 的區(qū)別(2)
Android學(xué)習(xí)筆記之ProgressDialog
mian.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:id="@+id/information" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="progressdialog"/> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="圓形"/> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="水平條"/> </LinearLayout>
java:
package Android2.test; import android.app.Activity; import android.app.ProgressDialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.View; import android.widget.Button; public class Android2Activity extends Activity { private Button Button1,Button2; int m_count = 0; //聲明進(jìn)度條對(duì)話框 ProgressDialog progressdialog; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //得到按鈕對(duì)象 Button1 = (Button)findViewById(R.id.button1); Button2 = (Button)findViewById(R.id.button2); //設(shè)置Button1的事件監(jiān)聽 Button1.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub //創(chuàng)建ProgressDialog對(duì)象 progressdialog = new ProgressDialog(Android2Activity.this); // 設(shè)置進(jìn)度條風(fēng)格,風(fēng)格為圓形,旋轉(zhuǎn)的 progressdialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); // 設(shè)置ProgressDialog 標(biāo)題 progressdialog.setTitle("提示"); // 設(shè)置ProgressDialog 提示信息 progressdialog.setMessage("正在緩沖中,請(qǐng)稍等....."); // 設(shè)置ProgressDialog 標(biāo)題圖標(biāo) // m_pDialog.setIcon(R.drawable.img1); // 設(shè)置ProgressDialog 的進(jìn)度條是否不明確 progressdialog.setIndeterminate(false); // 設(shè)置ProgressDialog 是否可以按退回按鍵取消 progressdialog.setCancelable(true); // 設(shè)置ProgressDialog 的一個(gè)Button progressdialog.setButton("確定", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int i) { //點(diǎn)擊“確定按鈕”取消對(duì)話框 dialog.cancel(); } }); // 讓ProgressDialog顯示 progressdialog.show(); } }); //設(shè)置Button2的事件監(jiān)聽 Button2.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub m_count = 0; // 創(chuàng)建ProgressDialog對(duì)象 progressdialog = new ProgressDialog(Android2Activity.this); // 設(shè)置進(jìn)度條風(fēng)格,風(fēng)格為長形 progressdialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); // 設(shè)置ProgressDialog 標(biāo)題 progressdialog.setTitle("提示"); // 設(shè)置ProgressDialog 提示信息 progressdialog.setMessage("正在緩沖中,請(qǐng)稍等....."); // 設(shè)置ProgressDialog 標(biāo)題圖標(biāo) // m_pDialog.setIcon(R.drawable.img2); // 設(shè)置ProgressDialog 進(jìn)度條進(jìn)度 progressdialog.setProgress(100); // 設(shè)置ProgressDialog 的進(jìn)度條是否不明確 progressdialog.setIndeterminate(false); // 設(shè)置ProgressDialog 是否可以按退回按鍵取消 progressdialog.setCancelable(true); // 讓ProgressDialog顯示 progressdialog.show(); new Thread() { public void run() { try { while (m_count <= 100) { // 由線程來控制進(jìn)度。 progressdialog.setProgress(m_count++); Thread.sleep(100); } progressdialog.cancel(); } catch (InterruptedException e) { progressdialog.cancel(); } } }.start(); } }); } }
posted on 2012-01-23 20:37
mixer-a
閱讀(411)
評(píng)論(0)
編輯
收藏
新用戶注冊(cè)
刷新評(píng)論列表
只有注冊(cè)用戶
登錄
后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
Powered by:
BlogJava
Copyright ©2025 mixer-a
主站蜘蛛池模板:
佛冈县
|
喀喇
|
石渠县
|
崇明县
|
舞阳县
|
莲花县
|
庆云县
|
孟州市
|
若羌县
|
扎囊县
|
微山县
|
迁西县
|
北海市
|
林口县
|
丰顺县
|
龙胜
|
北宁市
|
通许县
|
汉中市
|
丰原市
|
永清县
|
龙游县
|
南漳县
|
隆安县
|
仁怀市
|
正镶白旗
|
六安市
|
定南县
|
泰州市
|
柏乡县
|
凉山
|
纳雍县
|
北安市
|
壤塘县
|
汝南县
|
广西
|
上蔡县
|
历史
|
封开县
|
瓦房店市
|
门源
|