Android環(huán)形進(jìn)度條(安卓默認(rèn)形式)實(shí)例代碼
Android開發(fā)中,有很多的功能在實(shí)際應(yīng)用中都起了很大的作用,比如android進(jìn)度條的實(shí)現(xiàn)方式,下面給大家介紹Android環(huán)形進(jìn)度條(安卓默認(rèn)形式),具體內(nèi)容如下所示:
.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity" > <Button android:id="@+id/mybut" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="查找網(wǎng)絡(luò)"/> </LinearLayout>
.java
package com.example.progressdialog; import android.os.Bundle; import android.app.Activity; import android.app.ProgressDialog; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class MainActivity extends Activity { private Button but=null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); this.but=(Button) super.findViewById(R.id.mybut); this.but.setOnClickListener(new OnClickListenerImp()); } public class OnClickListenerImp implements OnClickListener{ public void onClick(View v) { //創(chuàng)建我們的進(jìn)度條 final ProgressDialog proDia=new ProgressDialog(MainActivity.this); proDia.setTitle("搜索網(wǎng)絡(luò)"); proDia.setMessage("請耐心等待"); proDia.onStart(); //匿名內(nèi)部類 new Thread(){ public void run(){ try{ Thread.sleep(3000); } catch(Exception e){ } finally{ //匿名內(nèi)部類要訪問類當(dāng)中的數(shù)據(jù),該數(shù)據(jù)必須為final proDia.dismiss();//隱藏對話框 } } }.start(); proDia.show(); } } }
以上內(nèi)容是小編給大家介紹的Android環(huán)形進(jìn)度條(安卓默認(rèn)形式)的相關(guān)知識,希望對大家有所幫助!
- Android實(shí)現(xiàn)環(huán)形進(jìn)度條
- Android自定義環(huán)形LoadingView效果
- Android自定義View實(shí)現(xiàn)環(huán)形進(jìn)度條的思路與實(shí)例
- Android實(shí)現(xiàn)計(jì)步進(jìn)度的環(huán)形Progress
- Android實(shí)現(xiàn)環(huán)形進(jìn)度條的實(shí)例
- Android實(shí)現(xiàn)環(huán)形進(jìn)度條代碼
- Android應(yīng)用中炫酷的橫向和環(huán)形進(jìn)度條的實(shí)例分享
- Android中制作進(jìn)度框和環(huán)形進(jìn)度條的簡單實(shí)例分享
- android自定義環(huán)形對比圖效果
相關(guān)文章
Android多進(jìn)程間采用AIDL方式進(jìn)行通信
這篇文章主要為大家詳細(xì)介紹了Android多進(jìn)程間采用AIDL方式進(jìn)行通信,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-04-04android 動態(tài)控制狀態(tài)欄顯示和隱藏的方法實(shí)例
這篇文章主要介紹了2013-12-12Android編程實(shí)現(xiàn)監(jiān)控各個(gè)程序流量的方法
這篇文章主要介紹了Android編程實(shí)現(xiàn)監(jiān)控各個(gè)程序流量的方法,涉及Android針對應(yīng)用包的遍歷,權(quán)限控制及相關(guān)屬性操作技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-12-12Android實(shí)現(xiàn)圖片異步加載并緩存到本地
這篇文章主要介紹了Android實(shí)現(xiàn)圖片異步加載并緩存到本地的相關(guān)資料,需要的朋友可以參考下2016-02-02