Example usage for android.app ProgressDialog show

List of usage examples for android.app ProgressDialog show

Introduction

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

Prototype

public static ProgressDialog show(Context context, CharSequence title, CharSequence message) 

Source Link

Document

Creates and shows a ProgressDialog.

Usage

From source file:ack.me.truconnectandroiddemo.MainActivity.java

private void initialiseListviewListener(ListView listView) {
    listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override/*www  .j a v a2s  .c  o  m*/
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            mCurrentDeviceName = mDeviceList.get(position);

            if (!mConnecting) {
                mConnecting = true;

                stopScan();
                Log.d(TAG, "Connecting to BLE device " + mCurrentDeviceName);
                mTruconnectManager.connect(mCurrentDeviceName);

                final ProgressDialog dialog = new ProgressDialog(MainActivity.this);
                String title = getString(R.string.progress_title);
                String msg = getString(R.string.progress_message);
                dialog.setIndeterminate(true);//Dont know how long connection could take.....
                dialog.setCancelable(true);

                mConnectProgressDialog = dialog.show(view.getContext(), title, msg);
                mConnectProgressDialog.setCancelable(true);
                mConnectProgressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
                    @Override
                    public void onCancel(DialogInterface dialogInterface) {
                        dialogInterface.dismiss();
                    }
                });

            }
        }
    });
}

From source file:am.roadpolice.roadpolice.ProgressDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    return ProgressDialog.show(getActivity(), getString(R.string.txtInfoLoading),
            getString(R.string.txtPleaseWait));
}

From source file:it.nacios.app.dialog.SimpleProgressDialog.java

@Override
public boolean execute(String action, final JSONArray args, final CallbackContext callbackContext)
        throws JSONException {
    if ("show".equals(action)) {
        final Context currentCtx = cordova.getActivity();
        cordova.getActivity().runOnUiThread(new Runnable() {
            @Override//from  w ww .j  a  v a  2 s .c o  m
            public void run() {
                String msg = null;
                try {
                    msg = args.getString(0);
                } catch (Exception e) {
                    msg = "Attendere prego...";
                }
                spd = ProgressDialog.show(currentCtx, "", msg);
                callbackContext.success();
            }
        });

        return true;
    } else if ("hide".equals(action)) {
        cordova.getActivity().runOnUiThread(new Runnable() {
            @Override
            public void run() {
                if (spd != null) {
                    spd.dismiss();
                    spd = null;
                }
                callbackContext.success();
            }
        });
        return true;
    }

    return false;
}

From source file:org.service.TaskInsert.java

/**
 * Antes de comenzar la tarea muestra el progressDialog
 *
 *//*from   w  w w.  j a  va2s  . c om*/
@Override
protected void onPreExecute() {
    super.onPreExecute();
    progressDialog = ProgressDialog.show(context, "Por favor espere", "Subiendo...");
}

From source file:com.dvdprime.mobile.android.task.ViewSaveTask.java

/**
 * Constructor.//w  ww.j a  va2 s.  c  o  m
 * 
 * @param context
 */
public ViewSaveTask(Context context) {
    super();
    this.mContext = context;
    mProgressDialog = ProgressDialog.show(mContext, "", mContext.getString(R.string.view_save_message));
    mProgressDialog.setCanceledOnTouchOutside(false);
    mProgressDialog.setCancelable(true);
    mProgressDialog.setOnCancelListener(new OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dlg) {
            DpApp.getRequestQueue().cancelAll(TAG);
        }
    });
}

From source file:com.nasatrainedmonkeys.roboinstaller.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);/*ww w.  j ava 2 s.  c om*/

    text = (TextView) findViewById(R.id.text);

    button = (Button) findViewById(R.id.button);
    button.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View view) {
            progress = ProgressDialog.show(MainActivity.this, "Installing...", "");

            Thread thread = new Thread(MainActivity.this);
            thread.start();
        }
    });
}

From source file:palamarchuk.fraudguide.utils.QueryMaster.java

public void setProgressDialog() {
    String downloading = context.getString(R.string.downloading);
    this.progressDialog = ProgressDialog.show(context, null, downloading);
}

From source file:com.dvdprime.mobile.android.task.ViewDeleteTask.java

/**
 * Constructor./*from  ww  w  .  j  a v a 2  s.  c  o  m*/
 * 
 * @param context
 */
public ViewDeleteTask(Activity activity) {
    super();
    this.mActivity = activity;
    mProgressDialog = ProgressDialog.show(activity, "", activity.getString(R.string.view_deleting_message));
    mProgressDialog.setCanceledOnTouchOutside(false);
    mProgressDialog.setCancelable(true);
    mProgressDialog.setOnCancelListener(new OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dlg) {
            DpApp.getRequestQueue().cancelAll(TAG);
        }
    });
}

From source file:com.manning.androidhacks.hack021.MainActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);//from   w w  w.  j av a2  s . c  o m

    mTextView = (TextView) findViewById(R.id.text_view);

    mProgressDialog = ProgressDialog.show(this, "Loading", "Please wait");
    mProgressDialog.show();

    mReceiver = new MyServiceReceiver();
    mIntentFilter = new IntentFilter(MyService.ACTION);

    startService(new Intent(this, MyService.class));
}

From source file:com.gruporaido.tasker_library.http.APIResponseHandler.java

public APIResponseHandler(Context context, FragmentManager fragmentManager, boolean showProgress) {
    super();/*  www .j  av  a 2  s. co  m*/
    mContext = context;
    mFragmentManager = fragmentManager;
    mShowProgress = showProgress;
    if (mShowProgress) {
        mProgressDialog = ProgressDialog.show(context, null, context.getString(R.string.loading_content));
    }
    onRequestStart();
}