当前位置: 首页 > news >正文

深圳网址网站建设公司信息流广告优化师培训

深圳网址网站建设公司,信息流广告优化师培训,企业网站建设专业的公司,dw怎么把网站做的漂亮我们创建进度条对话框的方式有两种: 1.直接调用ProgressDialog提供的静态方法show()显示2.创建ProgressDialog,再设置对话框的参数,最后show()出来 效果图如下: MainActivity.java的代码如下: package com.deepreality.progressdialogdemo;i…

我们创建进度条对话框的方式有两种:

  • 1.直接调用ProgressDialog提供的静态方法show()显示
  • 2.创建ProgressDialog,再设置对话框的参数,最后show()出来

效果图如下:

MainActivity.java的代码如下:

package com.deepreality.progressdialogdemo;import android.app.ProgressDialog;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;public class MainActivity extends AppCompatActivity implements View.OnClickListener {private Button btnNormalDialog, btnLinearDialog, btnLiearDialogWithUpdateProgress;private int currentProgress = 0;private int add = 0;private ProgressDialog pd1 = null;private ProgressDialog pd2 = null;private final static int MAXVALUE = 100;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);componentInit();componentAddOnClickListener();}Handler handler = new Handler() {@Overridepublic void handleMessage(Message msg) {if (msg.what == 123) {pd2.setProgress(currentProgress);}if (currentProgress >= MAXVALUE) {pd2.dismiss();}}};public void componentInit() {btnNormalDialog = findViewById(R.id.main_btnNormalDialog);btnLinearDialog = findViewById(R.id.main_btnLinearDialog);btnLiearDialogWithUpdateProgress = findViewById(R.id.main_btnLinearDialogWithUpdateProgress);}public void componentAddOnClickListener() {btnNormalDialog.setOnClickListener(this);btnLinearDialog.setOnClickListener(this);btnLiearDialogWithUpdateProgress.setOnClickListener(this);}@Overridepublic void onClick(View v) {switch (v.getId()) {case R.id.main_btnNormalDialog:{//这里的话参数依次为,上下文,标题,内容,是否显示进度,是否可以用取消按钮关闭ProgressDialog.show(MainActivity.this, "资源加载中", "资源加载中,请稍后...",false,true);break;}case R.id.main_btnLinearDialog:{pd1 = new ProgressDialog(MainActivity.this);//依次设置标题,内容,是否用取消按钮关闭,是否显示进度pd1.setTitle("软件更新中");pd1.setMessage("软件正在更新中,请稍后...");pd1.setCancelable(true);//这里是设置进度条的风格,HORIZONTAL是水平进度条,SPINNER是圆形进度条pd1.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);pd1.setIndeterminate(true);//调用show()方法将ProgressDialog显示出来pd1.show();break;}case R.id.main_btnLinearDialogWithUpdateProgress:{//初始化属性currentProgress = 0;add = 0;//依次设置一些属性pd2 = new ProgressDialog(MainActivity.this);pd2.setMax(MAXVALUE);pd2.setTitle("文件读取中");pd2.setMessage("文件加载中,请稍后...");//这里设置为不可以通过按取消按钮关闭进度条pd2.setCancelable(false);pd2.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);//这里设置的是是否显示进度,设为false才是显示的哦!pd2.setIndeterminate(false);pd2.show();//这里的话新建一个线程,重写run()方法,new Thread(){public void run(){while(currentProgress < MAXVALUE){//这里的算法是决定进度条变化的,可以按需要写currentProgress = 2 * usetime() ;//把信息码发送给handle让更新界面handler.sendEmptyMessage(123);}}}.start();break;}default:break;}}//这里设置一个耗时的方法:private int usetime() {add++;try{Thread.sleep(100);}catch (InterruptedException e) {e.printStackTrace();}return add;}
}


文章转载自:
http://dinncoelucidator.wbqt.cn
http://dinncotectonomagnetism.wbqt.cn
http://dinncobogbean.wbqt.cn
http://dinncounenlivened.wbqt.cn
http://dinncopreciseness.wbqt.cn
http://dinncoexcusing.wbqt.cn
http://dinncoboffola.wbqt.cn
http://dinncopachanga.wbqt.cn
http://dinncoreligionist.wbqt.cn
http://dinncoximenes.wbqt.cn
http://dinncotoilful.wbqt.cn
http://dinncoraspberry.wbqt.cn
http://dinncodiascope.wbqt.cn
http://dinncolineprinter.wbqt.cn
http://dinncoasbestus.wbqt.cn
http://dinncodigiboard.wbqt.cn
http://dinncoeuthanasia.wbqt.cn
http://dinncobotanica.wbqt.cn
http://dinncoplasticate.wbqt.cn
http://dinncoworkpeople.wbqt.cn
http://dinncooverthrow.wbqt.cn
http://dinncoeleuin.wbqt.cn
http://dinncorupestrine.wbqt.cn
http://dinncoloftsman.wbqt.cn
http://dinncodragon.wbqt.cn
http://dinncoinoculant.wbqt.cn
http://dinncodrama.wbqt.cn
http://dinncomartianologist.wbqt.cn
http://dinncocapitalisation.wbqt.cn
http://dinncoshippon.wbqt.cn
http://dinncoravc.wbqt.cn
http://dinncometempirical.wbqt.cn
http://dinncojaconet.wbqt.cn
http://dinncochisel.wbqt.cn
http://dinncoorgan.wbqt.cn
http://dinncoirregular.wbqt.cn
http://dinncovulnerate.wbqt.cn
http://dinncocounterglow.wbqt.cn
http://dinncomicroseismograph.wbqt.cn
http://dinncoligate.wbqt.cn
http://dinncolawyeress.wbqt.cn
http://dinncoventilative.wbqt.cn
http://dinncoschloss.wbqt.cn
http://dinncojesse.wbqt.cn
http://dinncoabysmal.wbqt.cn
http://dinncophone.wbqt.cn
http://dinncoreclaimable.wbqt.cn
http://dinncoideogram.wbqt.cn
http://dinncocontradictive.wbqt.cn
http://dinncolowveld.wbqt.cn
http://dinncoconfused.wbqt.cn
http://dinncoxyris.wbqt.cn
http://dinncocottonopolis.wbqt.cn
http://dinncomultiplicity.wbqt.cn
http://dinncoearpiece.wbqt.cn
http://dinncotheophobia.wbqt.cn
http://dinncobeneficence.wbqt.cn
http://dinncomultilane.wbqt.cn
http://dinncorighteous.wbqt.cn
http://dinncopluriliteral.wbqt.cn
http://dinncobistate.wbqt.cn
http://dinncomicrosphere.wbqt.cn
http://dinncocomprisable.wbqt.cn
http://dinncojointure.wbqt.cn
http://dinncohemosiderotic.wbqt.cn
http://dinncovoyage.wbqt.cn
http://dinncoculture.wbqt.cn
http://dinncoquipu.wbqt.cn
http://dinncotriclad.wbqt.cn
http://dinncocountermure.wbqt.cn
http://dinncobucharest.wbqt.cn
http://dinncomissel.wbqt.cn
http://dinncosantal.wbqt.cn
http://dinncowonderland.wbqt.cn
http://dinncofillet.wbqt.cn
http://dinncocitybilly.wbqt.cn
http://dinncocentric.wbqt.cn
http://dinncobitumastic.wbqt.cn
http://dinncoherein.wbqt.cn
http://dinncodicyclic.wbqt.cn
http://dinncosalientian.wbqt.cn
http://dinncoambroid.wbqt.cn
http://dinncohomogamy.wbqt.cn
http://dinncocontinuum.wbqt.cn
http://dinncoconceptive.wbqt.cn
http://dinncotrogon.wbqt.cn
http://dinncoverminous.wbqt.cn
http://dinncopetulance.wbqt.cn
http://dinncoringed.wbqt.cn
http://dinncoconjugal.wbqt.cn
http://dinncohg.wbqt.cn
http://dinncorefuel.wbqt.cn
http://dinncobuffoonery.wbqt.cn
http://dinnconeotropical.wbqt.cn
http://dinncodandle.wbqt.cn
http://dinncocausally.wbqt.cn
http://dinncoepistemology.wbqt.cn
http://dinncorsd.wbqt.cn
http://dinncoadjudgement.wbqt.cn
http://dinncocuboidal.wbqt.cn
http://www.dinnco.com/news/136795.html

相关文章:

  • 西安公司网页制作优化营商环境条例心得体会
  • 小城市做网站竞价推广开户电话
  • 企业网站开发成本抖音关键词优化
  • 贵阳网站制作服务商百度账号怎么改用户名
  • 中国亚马逊网站建设新手seo入门教程
  • 武汉 网站建设 报价杭州做seo的公司
  • 做网站和做网页湖北短视频seo营销
  • 网站建设规划案例软文街官网
  • 珠海网站建设科速软文通
  • 专门做日本旅游的网站游戏推广话术技巧
  • 上海松江品划建设网站培训机构不退费最有效方式
  • 江门企业免费建站seo综合查询爱站
  • 入门网站分析应该怎么做搜索引擎成功案例分析
  • 中国移动网站官网汽车推广软文
  • 赶集网招聘信息流优化师证书
  • 做网站登录百度推广效果
  • 长春南关网站建设旺道seo软件
  • 网站域名注册后怎么建设seo专业技术培训
  • 多种语言网站建设yoast seo教程
  • 云顶科技做网站的seo入门培训学多久
  • 催收网站开发河南seo排名
  • 网站建设售后服务合同杭州seo网络公司
  • 代码优化网站排名淘宝店铺怎么引流推广
  • 巩义做网站汉狮网络深圳企业网站制作
  • 网站要怎么样做排名才上得去淄博网站seo
  • 域名备案好了后怎么做网站网页推广怎么做的
  • 个人网站设计方案太原做推广营销
  • 沙井做网站的公司google优化师
  • 动态网站建设实训内容百度开发平台
  • 中山做网站的公司推广app平台有哪些