本文整理汇总了Java中android.app.ProgressDialog.setMax方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressDialog.setMax方法的具体用法?Java ProgressDialog.setMax怎么用?Java ProgressDialog.setMax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.ProgressDialog
的用法示例。
在下文中一共展示了ProgressDialog.setMax方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Bundle args = getArguments();
int size = args.getInt(ARG_SIZE);
String message = args.getString(ARG_MESSAGE);
messagingListener = new SimpleMessagingListener() {
@Override
public void updateProgress(int progress) {
dialog.setProgress(progress);
}
};
messagingController = MessagingController.getInstance(getActivity());
messagingController.addListener(messagingListener);
dialog = new ProgressDialog(getActivity());
dialog.setMessage(message);
dialog.setMax(size);
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.setProgress(0);
dialog.show();
return dialog;
}
示例2: onCreateDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected Dialog onCreateDialog(int id) {
//pDialog.show();
switch (id) {
case progress_bar_type:
pDialog = new ProgressDialog(this);
pDialog.setMessage("Downloading " + u + ".pdf");
pDialog.setIndeterminate(false);
pDialog.setMax(100);
pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
pDialog.setCancelable(true);
pDialog.setCanceledOnTouchOutside(false);
pDialog.setButton(ProgressDialog.BUTTON_NEGATIVE, "Background", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//Cancel download task
pDialog.cancel();
Toast.makeText(PdfSelector.this,
"Downloading in background", Toast.LENGTH_SHORT).show();
startActivity(new Intent(PdfSelector.this, Subjects.class));
//finish();
}
});
pDialog.show();
return pDialog;
default:
return null;
}
}
示例3: show
import android.app.ProgressDialog; //导入方法依赖的package包/类
public static void show(Context context) {
// 创建进度对话框
pd = new ProgressDialog(context);
pd.setMax(100);
// 设置对话框标题
pd.setTitle("下载更新");
// 设置对话框显示的内容
pd.setMessage("进度...");
// 设置对话框不能用取"消按"钮关闭
pd.setCancelable(false);
// 设置对话框的进度条风格
// pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
// 设置对话框的进度条是否显示进度
pd.setIndeterminate(false);
pd.show();
}
示例4: onPreExecute
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
m_dialog = new ProgressDialog(m_context);
m_dialog.setCancelable(true);
m_dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
m_dialog.setProgress(0);
m_dialog.setMax(getExternalNotes().size());
m_dialog.show();
}
示例5: getXApplicationList
import android.app.ProgressDialog; //导入方法依赖的package包/类
public static List<ApplicationInfoEx> getXApplicationList(Context context, ProgressDialog dialog) {
// Get references
PackageManager pm = context.getPackageManager();
// Get app list
SparseArray<ApplicationInfoEx> mapApp = new SparseArray<ApplicationInfoEx>();
List<ApplicationInfoEx> listApp = new ArrayList<ApplicationInfoEx>();
List<ApplicationInfo> listAppInfo = pm.getInstalledApplications(PackageManager.GET_META_DATA);
if (dialog != null)
dialog.setMax(listAppInfo.size());
for (int app = 0; app < listAppInfo.size(); app++) {
if (dialog != null)
dialog.setProgress(app + 1);
ApplicationInfo appInfo = listAppInfo.get(app);
Util.log(null, Log.INFO, "package=" + appInfo.packageName + " uid=" + appInfo.uid);
ApplicationInfoEx appInfoEx = new ApplicationInfoEx(context, appInfo.uid);
if (mapApp.get(appInfoEx.getUid()) == null) {
mapApp.put(appInfoEx.getUid(), appInfoEx);
listApp.add(appInfoEx);
}
}
// Sort result
Collections.sort(listApp);
return listApp;
}
示例6: getProgressDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
public static ProgressDialog getProgressDialog(Context context) {
ProgressDialog progressDialog = new ProgressDialog(context);
progressDialog.setCancelable(false);
progressDialog.setMax(100);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setMessage(context.getString(R.string.please_wait));
return progressDialog;
}
示例7: onPreExecute
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
progressDialog = new ProgressDialog(context);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setCancelable(false);
progressDialog.setIndeterminate(false);
progressDialog.setTitle(R.string.trimmer__deleting);
progressDialog.setMessage(context.getString(R.string.trimmer__deleting_old_messages));
progressDialog.setMax(100);
progressDialog.show();
}
示例8: setUpProgressDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
static void setUpProgressDialog(Context context) {
mProgressDialog = new ProgressDialog(context);
mProgressDialog.setCancelable(false);
mProgressDialog.setMessage(context.getString(R.string.loading));
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
mProgressDialog.setProgress(0);
mProgressDialog.setMax(100);
}
示例9: onPreExecute
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
super.onPreExecute();
mProgressDialog = new ProgressDialog(context);
mProgressDialog.setTitle("Progress...");
mProgressDialog.setMax(3);
mProgressDialog.show();
}
示例10: showProgressDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
private void showProgressDialog() {
progressDialog = new ProgressDialog(this);
progressDialog.setMessage(getString(R.string.please_wait));
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setMax(numberOfLines);
progressDialog.setCancelable(false);
progressDialog.show();
}
示例11: prepareProgressDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
private ProgressDialog prepareProgressDialog(Context context) {
ProgressDialog progressDialog = new ProgressDialog(context);
progressDialog.setTitle(R.string.stl_load_progress_title);
progressDialog.setMax(0);
progressDialog.setMessage(context.getString(R.string.stl_load_progress_message));
progressDialog.setIndeterminate(false);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setCancelable(false);
// progressDialog.show();
return progressDialog;
}
示例12: onPreExecute
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
super.onPreExecute();
progressDialog = new ProgressDialog(context, R.style.SciChart_ExportProgressDialogStyle);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setTitle(context.getString(R.string.export_all_examples));
progressDialog.setIndeterminate(false);
progressDialog.setMax(module.getExamples().size());
progressDialog.setCancelable(false);
progressDialog.setCanceledOnTouchOutside(false);
progressDialog.show();
}
示例13: onPreExecute
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
PreventActivity pa = wr.get();
if (pa != null) {
dialog = new ProgressDialog(pa);
dialog.setTitle(R.string.app_name);
dialog.setIcon(R.drawable.ic_launcher);
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.setCancelable(false);
dialog.setMax(mAdapter.getSize());
dialog.show();
labelLoader = new LabelLoader(pa);
}
}
示例14: showProgressDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
public void showProgressDialog(){
progressDialog= new ProgressDialog(MainActivity.this);
progressDialog.setMax(100);
progressDialog.setMessage("Loading Please wait ");
progressDialog.setTitle("Loading ");
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.show();
}
示例15: showProgressDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
public void showProgressDialog(){
progressDialog= new ProgressDialog(SecondActivity.this);
progressDialog.setMax(100);
progressDialog.setMessage("Loading Please wait ");
progressDialog.setTitle("Loading ");
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.show();
}