public static ProgressDialog createProgressDialog(Context mContext) { ProgressDialog dialog = new ProgressDialog(mContext); try { dialog.show(); } catch (BadTokenException e) { } dialog.setCancelable(false); dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); dialog.setContentView(R.layout.progressdialog); // dialog.setMessage(Message); return dialog; }
public void run() { activity.removeLifeCycleListener(BackgroundJob.this); if (dialog.getWindow() != null) dialog.dismiss(); } };
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; }
public void run() { mActivity.removeLifeCycleListener(BackgroundJob.this); if (mDialog.getWindow() != null) mDialog.dismiss(); } };
public void run() { mActivity.removeLifeCycleListener(BackgroundJob.this); if (mDialog.getWindow() != null) mDialog.dismiss(); } };
ProgressDialog pDialog = new ProgressDialog(MainActivity.this, R.style.AppTheme); pDialog.setCancelable(false); pDialog.setProgressStyle(android.R.style.Widget_ProgressBar_Small); pDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); pDialog.show();
private void displayProgress() { if (progressDialog == null) { progressDialog = new ProgressDialog(this); progressDialog.getWindow().addFlags(Window.FEATURE_NO_TITLE); progressDialog.setMessage("Getting location..."); } if (!progressDialog.isShowing()) { progressDialog.show(); } }
public void run() { activity.removeLifeCycleListener(BackgroundJob.this); if (dialog.getWindow() != null) dialog.dismiss(); } };
private void displayProgress() { if (progressDialog == null) { progressDialog = new ProgressDialog(this); progressDialog.getWindow().addFlags(Window.FEATURE_NO_TITLE); progressDialog.setMessage("Getting location..."); } if (!progressDialog.isShowing()) { progressDialog.show(); } }
private void dismissProgress() { if (mProgressDialog != null && mProgressDialog. isShowing() && mProgressDialog.getWindow() != null) { try { mProgressDialog.dismiss(); } catch ( IllegalArgumentException ignore ) { } } mProgressDialog = null; }
@Override public void run() { removeLifeCycleListener(Job.this); if (mDialog.getWindow() != null) { mDialog.dismiss(); } } };
//In your asynctask ProgressDialog progressDialog; //In onPreExecute progressDialog = new ProgressDialog(context); progressDialog.setMessage("Fetching images"); progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); progressDialog.setIndeterminate(true); progressDialog.setCancelable(false); progressDialog.getWindow().setGravity(Gravity.BOTTOM); progressDialog.show(); //In onPostExecute progressDialog.dismiss();
final ProgressDialog dialog = ProgressDialog.show(MainActivity.this, null, null); ProgressBar spinner = new android.widget.ProgressBar(MainActivity.this, null,android.R.attr.progressBarStyle); spinner.getIndeterminateDrawable().setColorFilter(Color.parseColor("#53CBF1"), android.graphics.PorterDuff.Mode.SRC_IN); dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); dialog.setContentView(spinner); dialog.setCancelable(false); dialog.show();
private void initProgressDialog() { mProgressDialog = new ProgressDialog(mContext); mProgressDialog.setMessage(mContext.getString(R.string.themes_progress)); mProgressDialog.setCancelable(false); if (mToken != null) { Window window = mProgressDialog.getWindow(); WindowManager.LayoutParams lp = window.getAttributes(); lp.token = mToken; lp.type = Trime.getDialogType(); window.setAttributes(lp); window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM); } }
public void run() { mActivity.removeLifeCycleListener(BackgroundJob.this); if (mDialog.getWindow() != null) mDialog.dismiss(); } };
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; }
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; }
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(true); progressDialog.setCanceledOnTouchOutside(false); return progressDialog; }
private void displayProgress() { if (progressDialog == null) { progressDialog = new ProgressDialog(getContext()); progressDialog.getWindow().addFlags(Window.FEATURE_NO_TITLE); progressDialog.setMessage("Getting location..."); } if (!progressDialog.isShowing()) { progressDialog.show(); } }
final ProgressDialog pd = new ProgressDialog(MainActivity.this); // Set progress dialog style spinner pd.setProgressStyle(ProgressDialog.STYLE_SPINNER); // Set the progress dialog title and message pd.setTitle("Title of progress dialog."); pd.setMessage("Loading........."); // Set the progress dialog background color pd.getWindow().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#FFD4D9D0"))); pd.setIndeterminate(false); // Finally, show the progress dialog pd.show();