android.app.ProgressDialog.setIndeterminate()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中android.app.ProgressDialog.setIndeterminate()方法的一些代码示例,展示了ProgressDialog.setIndeterminate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ProgressDialog.setIndeterminate()方法的具体详情如下:
包路径:android.app.ProgressDialog
类名称:ProgressDialog
方法名:setIndeterminate

ProgressDialog.setIndeterminate介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

ProgressDialog dialog = new ProgressDialog(this);
dialog.setMessage("Thinking...");
dialog.setIndeterminate(true);
dialog.setCancelable(false);
dialog.show();

代码示例来源:origin: stackoverflow.com

@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
  final ProgressDialog dialog = new ProgressDialog(getActivity());
  //
  dialog.setTitle(R.string.login_title);
  dialog.setMessage(getString(R.string.login_message));
  dialog.setIndeterminate(true);
  dialog.setCancelable(false);
  // etc...
  return dialog;
}

代码示例来源:origin: stackoverflow.com

ProgressDialog mProgressDialog = new ProgressDialog(Your_Activity.this);
mProgressDialog.setMessage("Here you can set a message");
mProgressDialog.setIndeterminate(false);
mProgressDialog.setMax(100);
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
mProgressDialog.show();
MyAsyncTask obj = new MyAsyncTask ();
obj.execute("url");

代码示例来源:origin: k9mail/k-9

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
  Bundle args = getArguments();
  String title = args.getString(ARG_TITLE);
  String message = args.getString(ARG_MESSAGE);
  ProgressDialog dialog = new ProgressDialog(getActivity());
  dialog.setIndeterminate(true);
  dialog.setTitle(title);
  dialog.setMessage(message);
  return dialog;
}

代码示例来源:origin: stackoverflow.com

import android.app.Dialog;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;

public class ProgressDialogFragment extends DialogFragment
{
  @Override
  public void onCreate(Bundle savedInstanceState)
  {
    super.onCreate(savedInstanceState);
    setCancelable(false);
  }

  @Override
  public Dialog onCreateDialog(Bundle savedInstanceState)
  {
    ProgressDialog dialog = new ProgressDialog(getActivity(), getTheme());
    dialog.setTitle(getString(R.string.pleaseWait));
    dialog.setMessage(getString(R.string.webpage_being_loaded));
    dialog.setIndeterminate(true);
    dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    return dialog;
  }
}

代码示例来源:origin: czy1121/update

@Override
public void onStart() {
  if (mContext instanceof Activity && !((Activity) mContext).isFinishing()) {
    ProgressDialog dialog = new ProgressDialog(mContext);
    dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    dialog.setMessage("下载中...");
    dialog.setIndeterminate(false);
    dialog.setCancelable(false);
    dialog.show();
    mDialog = dialog;
  }
}

代码示例来源:origin: stackoverflow.com

progressDialog.setMessage("Fetching route, Please wait...");
progressDialog.setIndeterminate(true);
progressDialog.show();

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
 ProgressDialog dlg=new ProgressDialog(getActivity());
 dlg.setMessage(getActivity().getString(R.string.dlg_title));
 dlg.setIndeterminate(true);
 dlg.setProgressStyle(ProgressDialog.STYLE_SPINNER);
 return(dlg);
}

代码示例来源:origin: stackoverflow.com

private class PrepareAdapter1 extends AsyncTask<Void,Void,ContactsListCursorAdapter > {
  ProgressDialog dialog;
  @Override
  protected void onPreExecute() {
    dialog = new ProgressDialog(viewContacts.this);
    dialog.setMessage(getString(R.string.please_wait_while_loading));
    dialog.setIndeterminate(true);
    dialog.setCancelable(false);
    dialog.show();
  }
  /* (non-Javadoc)
   * @see android.os.AsyncTask#doInBackground(Params[])
   */
  @Override
  protected ContactsListCursorAdapter doInBackground(Void... params) {
    cur1 = objItem.getContacts();
    startManagingCursor(cur1);

    adapter1 = new ContactsListCursorAdapter (viewContacts.this,
        R.layout.contact_for_listitem, cur1, new String[] {}, new int[] {});

    return adapter1;
  }

  protected void onPostExecute(ContactsListCursorAdapter result) {
    list.setAdapter(result);
    dialog.dismiss();
  }
}

代码示例来源:origin: stackoverflow.com

class Load extends AsyncTask<String, String, String> {
   @Override
   protected void onPreExecute() {
     super.onPreExecute();
     ProgressDialog progDailog = new ProgressDialog(Activity.this);
     progDailog.setMessage("Loading...");
     progDailog.setIndeterminate(false);
     progDailog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
     progDailog.setCancelable(true);
     progDailog.show();
   }
   @Override
   protected String doInBackground(String... aurl) {
     //do something while spinning circling show
     return null;
   }
   @Override
   protected void onPostExecute(String unused) {
     super.onPostExecute(unused);
     progDailog.dismiss();
   }
 }

代码示例来源:origin: stackoverflow.com

ProgressDialog dialog = new ProgressDialog(this); // this = YourActivity
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setMessage("Loading. Please wait...");
dialog.setIndeterminate(true);
dialog.setCanceledOnTouchOutside(false);
dialog.show();

代码示例来源:origin: stackoverflow.com

public void doBackup(View view) throws IOException{
  final ProgressDialog pd = new ProgressDialog(this);
  pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
  pd.setMessage("Running backup. Do not unplug drive");
  pd.setIndeterminate(true);
  pd.setCancelable(false);
  pd.show();
  Thread mThread = new Thread() {
    @Override
    public void run() {
      File source = new File("/mnt/extSdCard/DirectEnquiries"); 
      File dest = new File("/mnt/UsbDriveA/Backup");
      copyDirectory(source, dest);
      pd.dismiss();
    }
  };
  mThread.start();
}

代码示例来源:origin: rmtheis/android-ocr

@Override
protected void onPreExecute() {
 super.onPreExecute();
 dialog.setTitle("Please wait");
 dialog.setMessage("Checking for data installation...");
 dialog.setIndeterminate(false);
 dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
 dialog.setCancelable(false);
 dialog.show();
 activity.setButtonVisibility(false);
}

代码示例来源:origin: stackoverflow.com

dialog = new ProgressDialog(baraj_mapa.this);
dialog.setTitle("Calculating...");
dialog.setMessage("Please wait...");
dialog.setIndeterminate(true);
dialog.show();
dialog.dismiss();
String minim = result.get(0);
int min = Integer.parseInt(minim);

代码示例来源:origin: MindorksOpenSource/android-mvp-architecture

public static ProgressDialog showLoadingDialog(Context context) {
  ProgressDialog progressDialog = new ProgressDialog(context);
  progressDialog.show();
  if (progressDialog.getWindow() != null) {
    progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
  }
  progressDialog.setContentView(R.layout.progress_dialog);
  progressDialog.setIndeterminate(true);
  progressDialog.setCancelable(false);
  progressDialog.setCanceledOnTouchOutside(false);
  return progressDialog;
}

代码示例来源:origin: stackoverflow.com

public void getMovies() {

   ProgressDialog mProgressDialog = new ProgressDialog(this);
   mProgressDialog.setIndeterminate(true);
   mProgressDialog.setMessage("Loading...");
   mProgressDialog.show();
   MovieClient.getWeather().movies(MovieClient.getRandomMovie(), new Callback<MovieRequest>() {
   @Override
   public void success(MovieRequest movieRequest, Response response) {

     Picasso.with(getApplicationContext()).load(movieRequest.getPoster()).into(image);

     if (mProgressDialog.isShowing())
      mProgressDialog.dismiss();

  }

   @Override
   public void failure(RetrofitError error) {
     if (mProgressDialog.isShowing())
      mProgressDialog.dismiss();

     Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show();

   }
  });
}

代码示例来源: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.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();
protected void onPostExecute(Void result) {
  try {
    dialog.dismiss();
  } catch(Exception e) {

代码示例来源:origin: stackoverflow.com

protected void onPreExecute() {
  super.onPreExecute();
  pDialog = new ProgressDialog(PolyMap.this);
  pDialog.setMessage("Loading route. Please wait...");
  pDialog.setIndeterminate(false);
  pDialog.setCancelable(false);
  pDialog.show();
  pDialog.dismiss();

代码示例来源:origin: stackoverflow.com

switch (id) {
case progress_bar_type: // we set this to 0
  pDialog = new ProgressDialog(this);
  pDialog.setMessage("Downloading file. Please wait...");
  pDialog.setIndeterminate(false);
  pDialog.setMax(100);
  pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  pDialog.setCancelable(true);
  pDialog.show();
  return pDialog;
default:

相关文章