本文整理了Java中android.app.ProgressDialog.setProgress()
方法的一些代码示例,展示了ProgressDialog.setProgress()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ProgressDialog.setProgress()
方法的具体详情如下:
包路径:android.app.ProgressDialog
类名称:ProgressDialog
方法名:setProgress
暂无
代码示例来源:origin: stackoverflow.com
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
mProgressDialog.setCancelable(false);
mProgressDialog.show();
switch (resultCode) {
case Groundy.STATUS_PROGRESS:
mProgressDialog.setProgress(resultData.getInt(Groundy.KEY_PROGRESS));
break;
case Groundy.STATUS_FINISHED:
代码示例来源:origin: rmtheis/android-ocr
/**
* Update the dialog box with the latest incremental progress.
*
* @param message
* [0] Text to be displayed
* @param message
* [1] Numeric value for the progress
*/
@Override
protected void onProgressUpdate(String... message) {
super.onProgressUpdate(message);
int percentComplete = 0;
percentComplete = Integer.parseInt(message[1]);
dialog.setMessage(message[0]);
dialog.setProgress(percentComplete);
dialog.show();
}
代码示例来源:origin: stackoverflow.com
final Activity activity = this;
final ProgressDialog progressDialog = new ProgressDialog(activity);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setCancelable(false);
browser.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
progressDialog.show();
progressDialog.setProgress(0);
activity.setProgress(progress * 1000);
progressDialog.incrementProgressBy(progress);
if(progress == 100 && progressDialog.isShowing())
progressDialog.dismiss();
}
});
代码示例来源:origin: stackoverflow.com
protected void onPreExecute() {
dialog = new ProgressDialog(TheActivity.this);
dialog.setMessage("Uploading...");
dialog.setIndeterminate(false);
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.setProgress(0);
dialog.show();
dialog.setProgress(progress[0]);
代码示例来源:origin: adityak368/Android-FileBrowser-FilePicker
@Override
public void run() {
if(progressDialog!=null) {
progressDialog.setProgress(progress);
progressDialog.setMessage(msg);
}
}
};
代码示例来源:origin: stackoverflow.com
case PROGRESS_DIALOG:
progressDialog = new ProgressDialog(this);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setMessage("Loading");
progressDialog.setCancelable(true);
return progressDialog;
switch(id) {
case PROGRESS_DIALOG:
progressDialog.setProgress(0);
public void handleMessage(Message msg) {
int current = msg.arg1;
progressDialog.setProgress(current);
if (current >= 100){
removeDialog (PROGRESS_DIALOG);
代码示例来源:origin: stackoverflow.com
public class Utility {
public static ProgressDialog getProgressDialog(Context context) {
ProgressDialog progressDialog = new ProgressDialog(context,
R.style.TransparentDialog);
progressDialog.setCancelable(false);
progressDialog
.setProgressStyle(android.R.style.Widget_ProgressBar_Small);
progressDialog.setProgress(0);
return progressDialog;
}
}
代码示例来源:origin: stackoverflow.com
mProgressDialog.setMessage("Downloading file..");
mProgressDialog.setIndeterminate(false);
mProgressDialog.setMax(100);
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
mProgressDialog.setCancelable(true);
protected void onPreExecute() {
super.onPreExecute();
mProgressDialog.show();
mProgressDialog.setProgress(Integer.parseInt(progress[0]));
代码示例来源:origin: xiangzhihong/newsApp
private void openDialog(int newProgress) {
if (dialog == null) {
dialog = new ProgressDialog(VideoDetailActivity.this);
dialog.setProgress(newProgress);
dialog.setMessage("视频详情加载中。。。");
dialog.show();
} else {
dialog.setProgress(newProgress);
}
}
代码示例来源:origin: labexp/osmtracker-android
@Override
protected void onProgressUpdate(Long... values) {
if (values.length == 1) {
// Standard progress update
dialog.incrementProgressBy(values[0].intValue());
} else if (values.length == 3) {
// To initialise the dialog, 3 values are passed to onProgressUpdate()
// trackId, number of track points, number of waypoints
dialog.dismiss();
dialog = new ProgressDialog(context);
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.setIndeterminate(false);
dialog.setCancelable(false);
dialog.setProgress(0);
dialog.setMax(values[1].intValue() + values[2].intValue());
dialog.setTitle(
context.getResources().getString(R.string.trackmgr_exporting)
.replace("{0}", Long.toString(values[0])));
dialog.show();
}
}
代码示例来源:origin: posm/OpenMapKitAndroid
@Override
protected void onProgressUpdate(Long... progress) {
long percent = progress[0];
long elementsRead = progress[1];
long nodesRead = progress[2];
long waysRead = progress[3];
long relationsRead = progress[4];
Log.i("PARSER_PROGRESS",
"fileName=" + fileName + ", " +
"percent=" + percent + ", " +
"elementsRead=" + elementsRead + ", " +
"nodesRead=" + nodesRead + ", " +
"waysRead=" + waysRead + ", " +
"relationsRead=" + relationsRead);
progressDialog.setMessage("Parsing " + (completedFiles + 1) + " of " + totalFiles + " OSM XML Files.");
progressDialog.setProgress((int)percent);
}
代码示例来源:origin: stackoverflow.com
mProgress.setProgress(progress[0]);
mProgress.show();
代码示例来源:origin: stackoverflow.com
//Create a Progressdialog
ProgressDialog pd = new ProgressDialog(MyApp.this);
@Override
protected void onPreExecute()
{
//Set the Progressdialog
pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pd.setMessage("Getting data....");
}
@Override
protected void onProgressUpdate(Integer... args) {
//Update the Progressdialog
pd.setProgress(args[0]);
}
@Override
protected void onPostExecute(String result) {
//Dismiss Progressdialog
pd.dismiss();
}
代码示例来源:origin: stackoverflow.com
public class Utility {
public static ProgressDialog getProgressDialog(Context context) {
ProgressDialog progressDialog = new ProgressDialog(context,
R.style.TransparentDialog);
progressDialog.setCancelable(false);
progressDialog
.setProgressStyle(android.R.style.Widget_ProgressBar_Small);
progressDialog.setProgress(0);
return progressDialog;
}
}
代码示例来源:origin: k9mail/k-9
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Bundle args = getArguments();
long size = args.getLong(ARG_SIZE);
String message = args.getString(ARG_MESSAGE);
final SizeUnit sizeUnit = SizeUnit.getAppropriateFor(size);
messagingListener = new SimpleMessagingListener() {
@Override
public void updateProgress(int progress) {
dialog.setProgress(sizeUnit.valueInSizeUnit(progress));
}
};
messagingController = MessagingController.getInstance(getActivity());
messagingController.addListener(messagingListener);
dialog = new ProgressDialog(getActivity());
dialog.setMessage(message);
dialog.setMax(sizeUnit.valueInSizeUnit(size));
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.setProgress(0);
dialog.setProgressNumberFormat("%1d/%2d " + sizeUnit.shortName);
dialog.show();
return dialog;
}
代码示例来源:origin: xiangzhihong/newsApp
private void openDialog(int newProgress) {
if (dialog == null) {
dialog = new ProgressDialog(ArticleDetailActivity.this);
dialog.setProgress(newProgress);
dialog.setMessage("文章详情加载中。。。");
dialog.show();
} else {
dialog.setProgress(newProgress);
}
}
代码示例来源:origin: stackoverflow.com
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
mProgressDialog.setCancelable(false);
mProgressDialog.show();
switch (resultCode) {
case Groundy.STATUS_PROGRESS:
mProgressDialog.setProgress(resultData.getInt(Groundy.KEY_PROGRESS));
break;
case Groundy.STATUS_FINISHED:
代码示例来源:origin: openbmap/radiocells-scanner-android
/**
* Restores previously retained progress dialog state
*
* @param progressDialog
*/
public void restoreProgress(final ProgressDialog progressDialog) {
progressDialog.setTitle(mTitle);
progressDialog.setMessage(mMessage);
progressDialog.setProgress(mProgress);
}
代码示例来源:origin: stackoverflow.com
protected void onPreExecute() {
mProgressDialog = new ProgressDialog( mContext );
mProgressDialog.show();
mProgressDialog.setProgress( progress[0] );
代码示例来源:origin: stackoverflow.com
int progress = resultData.getInt("progress");
mypath = resultData.getString("mypath");
mProgressDialog.setProgress(progress);
mProgressDialog.setMessage("App name");
mProgressDialog.setIndeterminate(true);
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
mProgressDialog.setCancelable(true);
if (progress == 100) {
内容来源于网络,如有侵权,请联系作者删除!