mixer-a
BlogJava
::
首頁
::
新隨筆
::
聯系
::
聚合
::
管理
posts - 101, comments - 29, trackbacks - 0
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
給我留言
查看公開留言
查看私人留言
隨筆檔案
(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
搜索
最新評論
1.?re: android開發我的新浪微博客戶端-登錄頁面UI篇(4.1)[未登錄]
仿真時提示:No Launcher activity found!
--小龍
2.?re: android開發我的新浪微博客戶端-登錄頁面UI篇(4.1)[未登錄]
“新建名LoginActivity.java的Activity并且在AndroidManifest.xml中進行相應配置”請問怎么進行配置?因為新建的LoginActivity.java無法啟動仿真。
--小龍
3.?re: JS 時間處理和格式轉換
@Wanlic2008
不用把時間的年份拿出來單獨分析
--Wanlic2008
4.?re: JS 時間處理和格式轉換
評論內容較長,點擊標題查看
--Wanlic2008
5.?re: Android進階2之Http連接GET/POST請求
有用
--許大海
閱讀排行榜
1.?JS 時間處理和格式轉換(41185)
2.?Android進階2之Activity之間數據交流(onActivityResult的用法)(11501)
3.?[原]Android應用程序發送廣播(sendBroadcast)的過程分析(7302)
4.?[原]Android應用程序鍵盤(Keyboard)消息處理機制分析(4899)
5.?并行計算框架的Java實現--系列一(3785)
評論排行榜
1.?你想不到的壓縮方法:將javascript文件壓縮成PNG圖像存儲(4)
2.?MyEclipse快捷鍵設置(4)
3.?開發流程那些事:6天時間修改1行代碼(3)
4.?JS 時間處理和格式轉換(3)
5.?也談 GET 和 POST 的區別(2)
Android學習筆記之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; //聲明進度條對話框 ProgressDialog progressdialog; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //得到按鈕對象 Button1 = (Button)findViewById(R.id.button1); Button2 = (Button)findViewById(R.id.button2); //設置Button1的事件監聽 Button1.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub //創建ProgressDialog對象 progressdialog = new ProgressDialog(Android2Activity.this); // 設置進度條風格,風格為圓形,旋轉的 progressdialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); // 設置ProgressDialog 標題 progressdialog.setTitle("提示"); // 設置ProgressDialog 提示信息 progressdialog.setMessage("正在緩沖中,請稍等....."); // 設置ProgressDialog 標題圖標 // m_pDialog.setIcon(R.drawable.img1); // 設置ProgressDialog 的進度條是否不明確 progressdialog.setIndeterminate(false); // 設置ProgressDialog 是否可以按退回按鍵取消 progressdialog.setCancelable(true); // 設置ProgressDialog 的一個Button progressdialog.setButton("確定", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int i) { //點擊“確定按鈕”取消對話框 dialog.cancel(); } }); // 讓ProgressDialog顯示 progressdialog.show(); } }); //設置Button2的事件監聽 Button2.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub m_count = 0; // 創建ProgressDialog對象 progressdialog = new ProgressDialog(Android2Activity.this); // 設置進度條風格,風格為長形 progressdialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); // 設置ProgressDialog 標題 progressdialog.setTitle("提示"); // 設置ProgressDialog 提示信息 progressdialog.setMessage("正在緩沖中,請稍等....."); // 設置ProgressDialog 標題圖標 // m_pDialog.setIcon(R.drawable.img2); // 設置ProgressDialog 進度條進度 progressdialog.setProgress(100); // 設置ProgressDialog 的進度條是否不明確 progressdialog.setIndeterminate(false); // 設置ProgressDialog 是否可以按退回按鍵取消 progressdialog.setCancelable(true); // 讓ProgressDialog顯示 progressdialog.show(); new Thread() { public void run() { try { while (m_count <= 100) { // 由線程來控制進度。 progressdialog.setProgress(m_count++); Thread.sleep(100); } progressdialog.cancel(); } catch (InterruptedException e) { progressdialog.cancel(); } } }.start(); } }); } }
posted on 2012-01-23 20:37
mixer-a
閱讀(410)
評論(0)
編輯
收藏
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
Powered by:
BlogJava
Copyright ©2025 mixer-a
主站蜘蛛池模板:
安康市
|
崇左市
|
正定县
|
久治县
|
白银市
|
马公市
|
南通市
|
通辽市
|
星座
|
波密县
|
玉林市
|
壶关县
|
江西省
|
洛阳市
|
长春市
|
潍坊市
|
钟祥市
|
竹山县
|
浑源县
|
金塔县
|
金堂县
|
栾川县
|
盐池县
|
荥阳市
|
云林县
|
揭西县
|
东城区
|
珠海市
|
嘉峪关市
|
茌平县
|
富民县
|
河北省
|
泌阳县
|
阿坝
|
大安市
|
南阳市
|
竹山县
|
惠来县
|
公安县
|
衡阳县
|
全南县
|