当前位置:网站首页>Show progress bar above window
Show progress bar above window
2022-07-07 17:36:00 【XLMN】
Progress bar not used progressBar Components , Directly by the activity Method start up
There are two steps to display the progress bar on the window
1. call activity Of requeswindowfeatrue Method to set the style of the progress bar
2、 call activity Of setprogressbarVisibility(boolean) and setprogressbarindeterminte visibility(boolean) Method to control the display and hiding of the progress bar
//public class MainActivity extends Activity {
// Button bt1, bt2;
// int time;
//
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// // TODO Auto-generated method stub
// super.onCreate(savedInstanceState);
//
// // Set window features : Enable progress bar showing progress
// requestWindowFeature(Window.FEATURE_PROGRESS);
// // Set window features : Enable progress bars that do not show progress
// requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
// setContentView(R.layout.jindu);
// bt1 = (Button) findViewById(R.id.button1);
// bt2 = (Button) findViewById(R.id.button2);
// // by button Set event listening
// bt1.setOnClickListener(new OnClickListener() {
//
// @Override
// public void onClick(View arg0) {
// // TODO Auto-generated method stub
// // Show progress bar without progress
// setProgressBarIndeterminateVisibility(true);
// // Show progress bar with progress
// setProgressBarVisibility(true);
// // Set the progress bar's progress
// // The maximum progress of the display bar is 10000, If it is a control, you can set the maximum value by yourself
//
// new Thread() {
// public void run() {
// while (time < 100) {
//
// setProgress(times() * 100);
// }
// };
// }.start();
//
// }
// });
//
// // Set hidden progress bar
// bt2.setOnClickListener(new OnClickListener() {
//
// @Override
// public void onClick(View arg0) {
// // TODO Auto-generated method stub
// // Hide the progress bar without progress
// setProgressBarIndeterminateVisibility(false);
// // Hide the progress bar with progress
// setProgressBarVisibility(false);
//
// }
// });
//
// }
//
// public int times() {
// time++;
// try {
// Thread.sleep(100);
// } catch (InterruptedException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// return time;
// }
//}
//==========================
边栏推荐
猜你喜欢
随机推荐
actionBar 导航栏学习
MySQL implements the query of merging two fields into one field
From Devops to mlops: how do it tools evolve to AI tools?
[Fantan] how to design a test platform?
2021-06-28
AI来搞财富分配比人更公平?来自DeepMind的多人博弈游戏研究
【可信计算】第十一次课:TPM密码资源管理(三) NV索引与PCR
服务器彻底坏了,无法修复,如何利用备份无损恢复成虚拟机?
本周小贴士#135:测试约定而不是实现
SlashData开发者工具榜首等你而定!!!
Skimage learning (1)
Solidity 开发环境搭建
centos7安装mysql笔记
命令模式 - Unity
邮件服务器被列入黑名单,如何快速解封?
Enum + Validation 的个人最佳实践 demo 分享
【可信计算】第十三次课:TPM扩展授权与密钥管理
科普达人丨一文弄懂什么是云计算?
第2章搭建CRM项目开发环境(数据库设计)
How to implement safety practice in software development stage