List of usage examples for android.app ProgressDialog isShowing
public boolean isShowing()
From source file:Main.java
public static void closeDialog(ProgressDialog dialog) { if (dialog != null && dialog.isShowing()) { dialog.dismiss();//from www . ja v a 2s . co m } }
From source file:Main.java
public static void closeProgressDialog(ProgressDialog progressDialog) { if (progressDialog != null && progressDialog.isShowing()) { progressDialog.dismiss();/*from w w w . ja v a2s . co m*/ } }
From source file:Main.java
/** * Method to dismiss progress dialog./* ww w. j a v a 2 s . c o m*/ */ public static void dismissProgress(ProgressDialog mProgressDialog) { if (mProgressDialog != null && mProgressDialog.isShowing() && mProgressDialog.getContext() != null) { try { mProgressDialog.dismiss(); } catch (Exception e) { e.printStackTrace(); } } }
From source file:Main.java
/** * Stops progressDialog.//from ww w .j ava 2 s. c om * @param progressDialog -Progress dialog which needs to be stopped. */ public static void stopProgressDialog(ProgressDialog progressDialog) { if (progressDialog != null && progressDialog.isShowing()) { progressDialog.dismiss(); } }
From source file:Main.java
public static ProgressDialog showProgressDialog(Context context, String title, String message) { ProgressDialog pd = new ProgressDialog(context); pd.setTitle(title);//from w w w.ja v a 2 s . c o m pd.setMessage(message); if (pd != null && !pd.isShowing()) pd.show(); return pd; }
From source file:org.travey.travey.SurveysFragment.java
public void timerDelayRemoveDialog(long time, final ProgressDialog d) { new Handler().postDelayed(new Runnable() { public void run() { if (d.isShowing()) { TextView textView = (TextView) rootView.findViewById(R.id.textView); textView.setText(R.string.surveys_nointernet); d.dismiss();/* ww w.j av a2 s . c o m*/ } } }, time); }
From source file:com.arantius.tivocommander.SeasonPass.java
public void reorderApply(View unusedView) { Utils.log("SeasonPass::reorderApply() " + Boolean.toString(mInReorderMode)); boolean noChange = true; ArrayList<String> subIds = new ArrayList<String>(); for (int i = 0; i < mSubscriptionIds.size(); i++) { if (mSubscriptionIds.get(i) != mSubscriptionIdsBeforeReorder.get(i)) { noChange = false;/* w w w . j a va2 s .c o m*/ } subIds.add(mSubscriptionData.get(i).path("subscriptionId").asText()); } final ProgressDialog d = new ProgressDialog(this); final MindRpcResponseListener onReorderComplete = new MindRpcResponseListener() { public void onResponse(MindRpcResponse response) { if (d.isShowing()) { d.dismiss(); } // Flip the buttons. findViewById(R.id.reorder_enable).setVisibility(View.VISIBLE); findViewById(R.id.reorder_apply).setVisibility(View.GONE); // Turn off the drag handles. mInReorderMode = false; mListAdapter.notifyDataSetChanged(); } }; if (noChange) { // If there was no change, switch the UI back immediately. onReorderComplete.onResponse(null); } else { // Otherwise show a dialog while we do the RPC. d.setIndeterminate(true); d.setTitle("Saving ..."); d.setMessage("Saving new season pass order. " + "Patience please, this takes a while."); d.setCancelable(false); d.show(); SubscriptionsReprioritize req = new SubscriptionsReprioritize(subIds); MindRpc.addRequest(req, onReorderComplete); } }
From source file:com.gmail.charleszq.picorner.ui.MainSlideMenuActivity.java
/** * When first time this activity starts, load default photo list, now it's * flickr interesting photos./*w ww.ja v a 2 s . c om*/ */ void loadDefaultPhotoList() { MessageBus.reset(); mCommand = getDefaultCommand(); final ProgressDialog dialog = ProgressDialog.show(this, "", getString(R.string.loading_photos)); //$NON-NLS-1$ dialog.setCancelable(true); mCommand.setCommndDoneListener(new ICommandDoneListener<MediaObjectCollection>() { @Override public void onCommandDone(ICommand<MediaObjectCollection> command, MediaObjectCollection t) { MainSlideMenuActivity.this.onCommandDone(command, t); if (dialog != null && dialog.isShowing()) { try { dialog.dismiss(); } catch (Exception ex) { } } } }); mCommand.execute(); }
From source file:com.gh4a.BaseActivity.java
protected void stopProgressDialog(ProgressDialog progressDialog) { if (progressDialog != null && progressDialog.isShowing()) { progressDialog.dismiss();//www .j av a2 s .c o m } }
From source file:com.hzx.luoyechat.activity.SettingsFragment.java
void logout() { final ProgressDialog pd = new ProgressDialog(getActivity()); String st = getResources().getString(R.string.Are_logged_out); pd.setMessage(st);/* w w w. j av a2 s . co m*/ pd.setCanceledOnTouchOutside(false); pd.show(); DemoHXSDKHelper.getInstance().logout(true, new EMCallBack() { @Override public void onSuccess() { getActivity().runOnUiThread(new Runnable() { public void run() { if (pd.isShowing()) { pd.dismiss(); // ?? getActivity().finish(); startActivity(new Intent(getActivity(), LoginActivity.class)); } } }); } @Override public void onProgress(int progress, String status) { } @Override public void onError(int code, String message) { getActivity().runOnUiThread(new Runnable() { @Override public void run() { pd.dismiss(); Snackbar.make(check_new_version, "unbind devicetokens failed", Snackbar.LENGTH_SHORT) .show(); } }); } }); }