Android環(huán)形進(jìn)度條(安卓默認(rèn)形式)實(shí)例代碼
Android開(kāi)發(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("請(qǐng)耐心等待");
proDia.onStart();
//匿名內(nèi)部類(lèi)
new Thread(){
public void run(){
try{
Thread.sleep(3000);
}
catch(Exception e){
}
finally{
//匿名內(nèi)部類(lèi)要訪問(wèn)類(lèi)當(dāng)中的數(shù)據(jù),該數(shù)據(jù)必須為final
proDia.dismiss();//隱藏對(duì)話(huà)框
}
}
}.start();
proDia.show();
}
}
}
以上內(nèi)容是小編給大家介紹的Android環(huán)形進(jìn)度條(安卓默認(rèn)形式)的相關(guān)知識(shí),希望對(duì)大家有所幫助!
- 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)度條的簡(jiǎn)單實(shí)例分享
- android自定義環(huán)形對(duì)比圖效果
相關(guān)文章
Android編程之藍(lán)牙測(cè)試實(shí)例
這篇文章主要介紹了Android編程之藍(lán)牙測(cè)試,較為詳細(xì)的分析了Android藍(lán)牙測(cè)試的相關(guān)運(yùn)行環(huán)境與調(diào)試技巧,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2015-04-04
Android多進(jìn)程間采用AIDL方式進(jìn)行通信
這篇文章主要為大家詳細(xì)介紹了Android多進(jìn)程間采用AIDL方式進(jìn)行通信,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-04-04
android 動(dòng)態(tài)控制狀態(tài)欄顯示和隱藏的方法實(shí)例
這篇文章主要介紹了2013-12-12
Android編程實(shí)現(xiàn)監(jiān)控各個(gè)程序流量的方法
這篇文章主要介紹了Android編程實(shí)現(xiàn)監(jiān)控各個(gè)程序流量的方法,涉及Android針對(duì)應(yīng)用包的遍歷,權(quán)限控制及相關(guān)屬性操作技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-12-12
解決react-native軟鍵盤(pán)彈出擋住輸入框的問(wèn)題
這篇文章主要介紹了解決react-native軟鍵盤(pán)彈出擋住輸入框的問(wèn)題,本文通過(guò)實(shí)例圖文相結(jié)合給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-08-08
Android實(shí)現(xiàn)圖片異步加載并緩存到本地
這篇文章主要介紹了Android實(shí)現(xiàn)圖片異步加載并緩存到本地的相關(guān)資料,需要的朋友可以參考下2016-02-02

