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:com.listapp.ListappActivity.java

@Override
protected Dialog onCreateDialog(int id) {
    super.onCreateDialog(id);

    switch (id) {
    case ERR_DIALOG:
        AlertDialog errDialog = new AlertDialog.Builder(this)
                // See
                // http://code.google.com/p/android/issues/detail?id=6489
                .setMessage("").setCancelable(false).setNeutralButton("OK", new OnClickListener() {
                    @Override//from www .j  a v  a2  s  . com
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.cancel();
                    }
                }).create();
        return errDialog;

    case LOADING_DIALOG:
        ProgressDialog progressDialog = new ProgressDialog(mContext);
        progressDialog.setMessage("Loading...");
        progressDialog.setCancelable(true);
        progressDialog.setCanceledOnTouchOutside(false);
        // Listen for back button or cancel button in dialog itself
        progressDialog.setOnCancelListener(new OnCancelListener() {
            @Override
            public void onCancel(DialogInterface dialog) {
                if (taskInProgress != null) {
                    // TODO why doesn't this stop the HTTP request?
                    taskInProgress.cancel(true);
                }
            }
        });
        return progressDialog;

    default:
        return null;
    }
}

From source file:com.aidigame.hisun.imengstar.huanxin.SettingsFragment.java

void logout() {
    final ProgressDialog pd = new ProgressDialog(getActivity());
    pd.setMessage("..");
    pd.setCanceledOnTouchOutside(false);
    pd.show();/*from  w  ww. j  av  a 2  s. c  o m*/
    com.aidigame.hisun.imengstar.PetApplication.logout(new EMCallBack() {

        @Override
        public void onSuccess() {
            getActivity().runOnUiThread(new Runnable() {
                public void run() {
                    pd.dismiss();
                    // ??
                    ((MainActivity) getActivity()).finish();
                    //                  startActivity(new Intent(getActivity(), LoginActivity.class));

                }
            });
        }

        @Override
        public void onProgress(int progress, String status) {

        }

        @Override
        public void onError(int code, String message) {

        }
    });
}

From source file:com.linroid.pushapp.ui.bind.BindActivity.java

@OnClick(R.id.btn_bind)
public void onBindBtnClicked(Button btn) {
    final ProgressDialog dialog = new ProgressDialog(this, R.style.Theme_AppCompat_Light_Dialog);
    dialog.setIndeterminate(true);//ww  w  . j a va 2s .c  om
    dialog.setMessage(getString(R.string.msg_dialog_bind));
    dialog.setCancelable(false);
    dialog.show();
    authApi.bindDevice(bindToken, queryAndBuildDeviceInfo(), new Callback<Account>() {
        @Override
        @DebugLog
        public void success(Account authInfo, Response response) {
            Device device = authInfo.getDevice();
            User user = authInfo.getUser();
            String token = authInfo.getToken();
            account.setDevice(device);
            account.setUser(user);
            account.setToken(token);
            account.saveToFile();

            dialog.dismiss();
            redirectToHome();
        }

        @Override
        @DebugLog
        public void failure(RetrofitError error) {
            Snackbar.make(switcher, error.getMessage(), Snackbar.LENGTH_SHORT).show();
            dialog.dismiss();
        }
    });
}

From source file:com.feytuo.chat.activity.ContactlistFragment.java

/**
 * ?//from  w ww . j av a 2s.  co  m
 * 
 * @param toDeleteUser
 */
public void deleteContact(final User tobeDeleteUser) {
    final ProgressDialog pd = new ProgressDialog(getActivity());
    pd.setMessage("...");
    pd.setCanceledOnTouchOutside(false);
    pd.show();
    new Thread(new Runnable() {
        public void run() {
            try {
                EMContactManager.getInstance().deleteContact(tobeDeleteUser.getUsername());
                pd.dismiss();
            } catch (final Exception e) {
                pd.dismiss();
                Log.i(TAG, ": " + e.getMessage());

            }

        }
    }).start();

}

From source file:com.wenwen.chatuidemo.activity.SettingsFragment.java

void logout() {
    final ProgressDialog pd = new ProgressDialog(getActivity());
    pd.setMessage("..");
    pd.setCanceledOnTouchOutside(false);
    pd.show();//from  w  ww  .j av a 2 s.com
    DemoApplication.getInstance().logout(new EMCallBack() {

        @Override
        public void onSuccess() {
            getActivity().runOnUiThread(new Runnable() {
                public void run() {
                    pd.dismiss();
                    // ??
                    ((MainActivity) getActivity()).finish();
                    startActivity(new Intent(getActivity(), LoginActivity.class));

                }
            });
        }

        @Override
        public void onProgress(int progress, String status) {

        }

        @Override
        public void onError(int code, String message) {

        }
    });
}

From source file:com.almarsoft.GroundhogReader.ComposeActivity.java

@Override
protected Dialog onCreateDialog(int id) {
    if (id == ID_DIALOG_POSTING) {
        ProgressDialog loadingDialog = new ProgressDialog(this);
        loadingDialog.setMessage(getString(R.string.posting_message));
        loadingDialog.setIndeterminate(true);
        loadingDialog.setCancelable(true);
        return loadingDialog;
    }/*from w w  w. j  a  va  2s . co  m*/

    return super.onCreateDialog(id);
}

From source file:com.ccxt.whl.activity.ContactlistFragment.java

/**
 * user???/*from  ww w.ja  va 2 s .  c om*/
 */
private void moveToBlacklist(final String username) {
    final ProgressDialog pd = new ProgressDialog(getActivity());
    pd.setMessage("???...");
    pd.setCanceledOnTouchOutside(false);
    pd.show();
    new Thread(new Runnable() {
        public void run() {
            try {
                //???
                EMContactManager.getInstance().addUserToBlackList(username, true);
                getActivity().runOnUiThread(new Runnable() {
                    public void run() {
                        pd.dismiss();
                        Toast.makeText(getActivity(), "????", 0).show();
                    }
                });
            } catch (EaseMobException e) {
                e.printStackTrace();
                getActivity().runOnUiThread(new Runnable() {
                    public void run() {
                        pd.dismiss();
                        Toast.makeText(getActivity(), "???", 0).show();
                    }
                });
            }
        }
    }).start();

}

From source file:com.safeness.im.activity.SettingsFragment.java

void logout() {
    final ProgressDialog pd = new ProgressDialog(getActivity());
    pd.setMessage("..");
    pd.setCanceledOnTouchOutside(false);
    pd.show();/*from   w  w w .j a  v  a  2  s .com*/
    PatientApplication.getInstance().logout(new EMCallBack() {

        @Override
        public void onSuccess() {
            getActivity().runOnUiThread(new Runnable() {
                public void run() {
                    pd.dismiss();
                    // ??
                    ((MainActivity) getActivity()).finish();
                    startActivity(new Intent(getActivity(), LoginActivity.class));

                }
            });
        }

        @Override
        public void onProgress(int progress, String status) {

        }

        @Override
        public void onError(int code, String message) {

        }
    });
}

From source file:com.safeness.im.activity.ContactlistFragment.java

/**
 * user???/*from w  ww . j  a va 2s . c  o  m*/
 */
private void moveToBlacklist(final String username) {
    final ProgressDialog pd = new ProgressDialog(getActivity());
    pd.setMessage("???...");
    pd.setCanceledOnTouchOutside(false);
    pd.show();
    new Thread(new Runnable() {
        public void run() {
            try {
                //???
                EMContactManager.getInstance().addUserToBlackList(username, false);
                getActivity().runOnUiThread(new Runnable() {
                    public void run() {
                        pd.dismiss();
                        Toast.makeText(getActivity(), "????", Toast.LENGTH_SHORT).show();
                        refresh();
                    }
                });
            } catch (EaseMobException e) {
                e.printStackTrace();
                getActivity().runOnUiThread(new Runnable() {
                    public void run() {
                        pd.dismiss();
                        Toast.makeText(getActivity(), "???", Toast.LENGTH_SHORT).show();
                    }
                });
            }
        }
    }).start();

}

From source file:com.feytuo.chat.activity.ContactlistFragment.java

/**
 * user???//from  w ww.j a v  a  2  s.  c  om
 */
private void moveToBlacklist(final String username) {
    final ProgressDialog pd = new ProgressDialog(getActivity());
    pd.setMessage("???...");
    pd.setCanceledOnTouchOutside(false);
    pd.show();
    new Thread(new Runnable() {
        public void run() {
            try {
                //???
                EMContactManager.getInstance().addUserToBlackList(username, true);
                getActivity().runOnUiThread(new Runnable() {
                    public void run() {
                        pd.dismiss();
                        Toast.makeText(getActivity(), "????", Toast.LENGTH_SHORT).show();
                    }
                });
            } catch (final EaseMobException e) {
                e.printStackTrace();
                getActivity().runOnUiThread(new Runnable() {
                    public void run() {
                        pd.dismiss();
                        Log.i(TAG, "???" + e.getMessage());
                        Toast.makeText(getActivity(), "???", Toast.LENGTH_SHORT).show();
                    }
                });
            }
        }
    }).start();

}