st0*_*0le 42
你需要调用requestWindowFeature在onCreate之前setContentView
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.search_screen);
Run Code Online (Sandbox Code Playgroud)
并且假设您正在使用AsyncTask填充列表
onPreExecute() 将会通知 setProgressBarIndeterminateVisibility(true);
onPostExecute() 将会通知 setProgressBarIndeterminateVisibility(false);
RAA*_*AAM 13
我在我的申请中做了旋转进度条.希望这会对你有所帮助.
progDailog = ProgressDialog.show(this, "Progress_bar or give anything you want",
"Give message like ....please wait....", true);
new Thread() {
public void run() {
try {
// sleep the thread, whatever time you want.
sleep(2000);
} catch (Exception e) {
}
progDailog.dismiss();
}
}.start();
Run Code Online (Sandbox Code Playgroud)
如果你还有疑问,请告诉我.
ProgressDialog dialog = new ProgressDialog(youravtivity.this);
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setMessage("Loading. Please wait...");
dialog.setIndeterminate(true);
dialog.setCanceledOnTouchOutside(false);
dialog.show();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
35465 次 |
| 最近记录: |