Example usage for android.app ProgressDialog setMessage

List of usage examples for android.app ProgressDialog setMessage

Introduction

In this page you can find the example usage for android.app ProgressDialog setMessage.

Prototype

@Override
    public void setMessage(CharSequence message) 

Source Link

Usage

From source file:org.odk.collect.android.fragments.dialogs.FormLoadingDialogFragment.java

@NonNull
@Override//from   ww  w.j  a v  a2s .  c o m
public Dialog onCreateDialog(Bundle savedInstanceState) {
    setCancelable(false);

    ProgressDialog dialog = new ProgressDialog(getActivity(), getTheme());
    dialog.setTitle(R.string.loading_form);
    dialog.setMessage(getString(R.string.please_wait));
    dialog.setButton(getString(R.string.cancel_loading_form),
            (dialog1, which) -> listener.onCancelFormLoading());
    return dialog;
}

From source file:com.amalgam.app.SupportProgressDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Bundle args = getArguments();/*from  w  w  w  .ja va  2 s.c o m*/
    String title = args.getString(ARGS_TITLE);
    String message = args.getString(ARGS_MESSAGE);
    boolean indeterminate = args.getBoolean(ARGS_INDETERMINATE);
    ProgressDialog dialog = new ProgressDialog(getActivity());
    if (title != null) {
        dialog.setTitle(title);
    }
    dialog.setMessage(message);
    dialog.setIndeterminate(indeterminate);
    return dialog;
}

From source file:net.sourceforge.servestream.utils.LoadingDialog.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    // Use the Builder class for convenient dialog construction
    ProgressDialog loadingDialog = null;
    loadingDialog = new ProgressDialog(getActivity());
    loadingDialog.setMessage(mDialogText);
    loadingDialog.setCancelable(true);/*from  w w w  .j ava2 s  .c  o  m*/
    loadingDialog.setOnCancelListener(this);
    return loadingDialog;
}

From source file:com.jaanussiim.slimtimer.android.activities.LoginActivity.java

@Override
protected Dialog onCreateDialog(final int id) {
    switch (id) {
    case DIALOG_LOGGING_IN: {
        ProgressDialog dialog = new ProgressDialog(this);
        dialog.setMessage(getText(R.string.logging_in_message));
        dialog.setIndeterminate(true);//  w ww.  ja  va  2  s.co m
        dialog.setCancelable(true);
        dialog.setOnCancelListener(this);
        return dialog;
    }
    case DIALOG_AUTHENTICATION_ERROR:
    case DIALOG_NETWORK_ERROR:
    case DIALOG_UNKNOWN_ERROR:
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(R.string.login_error_dialog_title);
        if (id == DIALOG_AUTHENTICATION_ERROR) {
            builder.setMessage(R.string.login_error_authentication_error);
        } else if (id == DIALOG_NETWORK_ERROR) {
            builder.setMessage(R.string.login_error_network_error);
        } else {
            builder.setMessage(R.string.login_error_network_error);
        }
        builder.setIcon(android.R.drawable.ic_dialog_alert);
        builder.setPositiveButton(R.string.button_title_ok, null);
        return builder.create();
    default:
        return super.onCreateDialog(id);
    }
}

From source file:com.esri.arcgisruntime.sample.generateofflinemapwithlocalbasemap.ProgressDialogFragment.java

@NonNull
@Override//from   www . j  ava  2 s  .  c o  m
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
    super.onCreateDialog(savedInstanceState);
    // create a dialog to show progress
    final ProgressDialog progressDialog = new ProgressDialog(getActivity());
    progressDialog.setTitle(mTitle);
    progressDialog.setMessage(mMessage);
    progressDialog.setIndeterminate(false);
    progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    progressDialog.setMax(100);
    progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, mCancel, (dialog, which) -> onDismiss(dialog));
    return progressDialog;
}

From source file:ca.ualberta.cmput301w14t08.geochan.fragments.ExpandImageFragment.java

/**
 * Initializes the UI of the fragment./* w  w w .  ja  v a  2  s .  co m*/
 */
@Override
public void onStart() {
    super.onStart();
    ProgressDialog dialog = new ProgressDialog(getActivity());
    dialog.setMessage("Downloading Image");
    ImageView imageView = (ImageView) getView().findViewById(R.id.expanded_image);
    final Bitmap image = CacheManager.getInstance().deserializeImage(id);
    if (image == null) {
        // Start the image getter thread.
        ThreadManager.startGetImage(id, imageView, dialog);
    } else {
        imageView.setImageBitmap(image);
        ThreadManager.startGetImage(id, imageView, null);
    }
    LinearLayout rlayout = (LinearLayout) getView().findViewById(R.id.expanded_image_relative);
    rlayout.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            getFragmentManager().popBackStack();
        }
    });
    Button saveButton = (Button) getView().findViewById(R.id.save_image_button);
    saveButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            ContentValues values = new ContentValues();
            values.put(Images.Media.TITLE, id);
            values.put(Images.Media.DESCRIPTION, id);
            values.put(Images.Media.MIME_TYPE, "image/jpeg");
            values.put(Images.Media.DATE_TAKEN, System.currentTimeMillis());

            Uri uri = null;
            ContentResolver contentResolver = getActivity().getContentResolver();
            try {
                uri = contentResolver.insert(Images.Media.EXTERNAL_CONTENT_URI, values);
                OutputStream imageOut = contentResolver.openOutputStream(uri);
                try {
                    image.compress(Bitmap.CompressFormat.JPEG, 90, imageOut);
                } finally {
                    imageOut.close();
                }
                Toast.makeText(getActivity(), "Saved to gallery.", Toast.LENGTH_SHORT).show();
            } catch (Exception e) {
                Toaster.toastShort("Failed to save to gallery.");
                if (uri != null) {
                    contentResolver.delete(uri, null, null);
                    uri = null;
                }
            }
        }
    });
}

From source file:org.mobisocial.corral.BackgroundableDownloadDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    ProgressDialog d = new ProgressDialog(getActivity());
    d.setTitle("Fetching file");
    d.setMessage("Preparing to download...");
    d.setIndeterminate(true);/*  ww w . j a v  a 2  s .  co  m*/
    d.setCancelable(true);
    d.setButton(DialogInterface.BUTTON_POSITIVE, "Background", mBackgroundListener);
    d.setButton(DialogInterface.BUTTON_NEGATIVE, "Cancel", mCancelListener);
    return d;
}

From source file:com.photocitygame.android.ImageActivity.java

protected void uploadPhoto(User user) {
    if (user == null) {
        Log.e("PhotoCity", "No user!");
        Toast.makeText(this, "Error uploading image", Toast.LENGTH_SHORT).show();
        return;/*w w  w .  ja  va 2 s.c om*/
    }
    ProgressDialog dialog = new ProgressDialog(this);
    dialog.setMessage("Uploading");
    File f = Environment.getExternalStorageDirectory();
    File dir = new File(f, "photocity");
    try {
        FileInputStream in = new FileInputStream(new File(dir, "image.jpg"));
        ImageUploader uploader = new ImageUploader(this, in, user.getUserId(), flag, model);
        uploader.setProgressDialog(dialog);
        new Thread(uploader).start();
    } catch (FileNotFoundException ex) {
        Log.e("PhotoCity", "Error Uploading Image", ex);
        Toast.makeText(this, "Error uploading image", Toast.LENGTH_SHORT).show();
    }
}

From source file:com.smapley.vehicle.activity.SetActivity.java

private void updatePic(File file) {
    if (file != null) {
        ProgressDialog dialog = new ProgressDialog(this);
        dialog.setMessage("");
        RequestParams params = new RequestParams(Constant.URL_ADDPHOTO);
        params.addBodyParameter("ukey", (String) SP.getUser("ukey"));
        params.addBodyParameter("name", file);
        dialog.show();/*from   w  w  w  .  ja  v  a2 s  .c  om*/
        x.http().post(params, new BaseCallback<Map>(dialog) {
            @Override
            public void success(Map result) {
                if (StringUtils.isNoneEmpty(result.get("filename").toString()))
                    x.image().bind(image, Constant.URL_IMG + result.get("filename"), circleImage);
            }
        });
    }

}

From source file:net.evendanan.android.thumbremote.ui.FragmentAlertDialogSupport.java

private Dialog creatDiscoveryProgressDialog() {
    ProgressDialog p = new ProgressDialog(getActivity());
    p.setTitle(R.string.discoverying_dialog_title);
    p.setMessage(getString(R.string.discoverying_dialog_message));
    p.setIndeterminate(true);/* w  ww .  j  av  a 2s.c o m*/
    p.setCancelable(false);

    return p;
}