ProgressDialog show - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ProgressDialog show method.

This code example shows how to use the following methods:show
	public static void runWithMessage(final Activity activity, String key, final Runnable action, final Runnable postAction, final boolean minPriority) {
		final String message =
			ZLResource.resource("dialog").getResource("waitMessage").getResource(key).getValue();
		activity.runOnUiThread(new Runnable() {
			public void run() { 
				final ProgressDialog progress = ProgressDialog.show(activity, null, message, true, false);
 
				final Thread runner = new Thread() {
					public void run() { 
						action.run();
						activity.runOnUiThread(new Runnable() {
							public void run() { 
								try { 
									progress.dismiss();
								} catch (Exception e) {
									e.printStackTrace();
								} 
								if (postAction != null) {
									postAction.run();
								} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setTitle, setIndeterminate
    @Override 
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        Bundle args = getArguments();
        String title = args.getString(ARG_TITLE);
 
        ProgressDialog dialog = new ProgressDialog(getActivity());
        dialog.setIndeterminate(true);
        dialog.setTitle(title);
 
        return dialog;
    } 
} 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:dismiss, getOwnerActivity
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:requestWindowFeature, setMessage
    } 
 
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mSpinner = new ProgressDialog(getContext());
        mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
        mSpinner.setMessage("Loading...");
 
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        mContent = new RelativeLayout(getContext());
 
        setUpWebView(); 
 
        // setUpCloseBtn(); 
 
        addContentView(mContent, new LayoutParams(LayoutParams.FILL_PARENT,
                LayoutParams.FILL_PARENT));
    } 
 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:isShowing, show, setMessage
 
	@Override 
	protected void onProgressUpdate(String... values) {
		super.onProgressUpdate(values);
		if (values != null && values.length > 0) {
			dialog.setMessage(values[0]);
		} 
		if (!dialog.isShowing()) {
			dialog.show();
		} 
	} 
 
	@Override 
	protected void onPostExecute(Boolean success) {
		super.onPostExecute(success);
		dialog.dismiss();
		if (callback != null) {
			callback.execute();
		} 
	} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:isShowing, setMax, setProgress
    public synchronized boolean isShowing() { 
        return dialog != null && dialog.isShowing();
    } 
 
    public synchronized void setMaxProgressAndReset(final int max) {
        if (dialog != null && dialog.isShowing()) {
            final int modMax = max / this.progressDivider;
            dialog.setMax(modMax);
            dialog.setProgress(0);
        } 
        this.progress = 0;
    } 
 
    public synchronized void setProgress(final int progress) {
        final int modProgress = progress / this.progressDivider;
        if (dialog != null && dialog.isShowing()) {
            dialog.setProgress(modProgress);
        } 
        this.progress = modProgress;
    } 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setOnCancelListener, show, setMessage
		dialog.dismiss();
	} 
 
	@Override 
	protected void onPreExecute() { 
		dialog = new ProgressDialog(context);
		dialog.setMessage("Removing Feed");
		dialog.setOnCancelListener(new OnCancelListener() {
 
			@Override 
			public void onCancel(DialogInterface dialog) {
				cancel(true);
 
			} 
 
		}); 
		dialog.show();
	} 
 
	@SuppressLint("NewApi") 

8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:isShowing, show, setMessage
 
	@Override 
	protected void onProgressUpdate(String... values) {
		super.onProgressUpdate(values);
		if (values != null && values.length > 0) {
			dialog.setMessage(values[0]);
		} 
		if (!dialog.isShowing()) {
			dialog.show();
		} 
	} 
 
	@Override 
	protected void onPostExecute(Boolean success) {
		super.onPostExecute(success);
		dialog.dismiss();
		if (callback != null) {
			callback.execute();
		} 
	} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setCancelable, setOnCancelListener, setIndeterminate
		return mAsyncTask != null;
	} 
	 
	private void setupProgressDialog(Context context, OnTaskCompleteListener taskCompleteListener) {
		// Setup progress dialog 
		mProgressDialog = new ProgressDialog(context);
		mProgressDialog.setIndeterminate(true);
		mProgressDialog.setCancelable(true);
		mProgressDialog.setOnCancelListener(this);
	} 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:requestWindowFeature, setMessage
 
		@Override 
		protected void onCreate(Bundle savedInstanceState)
			{ 
				super.onCreate(savedInstanceState);
				mSpinner = new ProgressDialog(getContext());
				mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
				mSpinner.setMessage("Loading...");
 
				mContent = new LinearLayout(getContext());
				mContent.setOrientation(LinearLayout.VERTICAL);
				setUpTitle(); 
				setUpWebView(); 
				Display display = getWindow().getWindowManager().getDefaultDisplay();
				final float scale = getContext().getResources().getDisplayMetrics().density;
				float[] dimensions = (display.getWidth() < display.getHeight()) ? DIMENSIONS_PORTRAIT : DIMENSIONS_LANDSCAPE;
				addContentView(mContent, new FrameLayout.LayoutParams((int) (dimensions[0] * scale + 0.5f), (int) (dimensions[1] * scale + 0.5f)));
			} 
 
		private void setUpTitle() 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related ProgressDialog show Questions & Answers: