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.imalu.alyou.activity.FriendlistFragment.java

/**
 * ?// w ww.j  a  v  a  2 s  .c o  m
 * 
 * @param toDeleteUser
 */
public void deleteContact(final HXUser 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());
    //               // db?
    //               UserDao dao = new UserDao(getActivity());
    //               dao.deleteContact(tobeDeleteUser.getUsername());
    //               AlUApplication.getInstance().getContactList().remove(tobeDeleteUser.getUsername());
    //               getActivity().runOnUiThread(new Runnable() {
    //                  public void run() {
    //                     pd.dismiss();
    ////                     adapter.remove(tobeDeleteUser);
    //                     adapter.notifyDataSetChanged();
    //
    //                  }
    //               });
    //            } catch (final Exception e) {
    //               getActivity().runOnUiThread(new Runnable() {
    //                  public void run() {
    //                     pd.dismiss();
    //                     Toast.makeText(getActivity(), ": " + e.getMessage(), 1).show();
    //                  }
    //               });
    //
    //            }
    //
    //         }
    //      }).start();

}

From source file:com.imalu.alyou.activity.ContactlistFragment.java

/**
 * ?/*from   w  ww  .ja va  2 s . c  o m*/
 * 
 * @param toDeleteUser
 */
public void deleteContact(final HXUser 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());
    //               // db?
    //               UserDao dao = new UserDao(getActivity());
    //               dao.deleteContact(tobeDeleteUser.getUsername());
    //               AlUApplication.getInstance().getContactList().remove(tobeDeleteUser.getUsername());
    //               getActivity().runOnUiThread(new Runnable() {
    //                  public void run() {
    //                     pd.dismiss();
    //                     adapter.remove(tobeDeleteUser);
    //                     adapter.notifyDataSetChanged();
    //
    //                  }
    //               });
    //            } catch (final Exception e) {
    //               getActivity().runOnUiThread(new Runnable() {
    //                  public void run() {
    //                     pd.dismiss();
    //                     Toast.makeText(getActivity(), ": " + e.getMessage(), 1).show();
    //                  }
    //               });
    //
    //            }
    //
    //         }
    //      }).start();

}

From source file:com.example.parkhere.provider.AddSeekerRoleFragment.java

public void createSeekerProfileProcess(SeekerPayment seekerPayment, BillingAddress billingAddress,
        Vehicle vehicle) {// ww w . ja  va 2  s.  co  m
    final ProgressDialog progressDialog = new ProgressDialog(rootView.getContext(),
            R.style.AppTheme_Dark_Dialog);
    progressDialog.setIndeterminate(true);
    progressDialog.setMessage("Adding Seeker Role...");
    progressDialog.show();

    Retrofit retrofit = new Retrofit.Builder().baseUrl(Constants.BASE_URL)
            .addConverterFactory(GsonConverterFactory.create()).build();

    RequestInterface requestInterface = retrofit.create(RequestInterface.class);

    ServerRequest request = new ServerRequest();
    request.setOperation(Constants.ADD_SEEKER_ROLE_OPERATION);
    request.setUser(user);
    request.setSeekerPayment(seekerPayment);
    request.setBillingAddress(billingAddress);
    request.setVehicle(vehicle);
    Call<ServerResponse> response = requestInterface.operation(request);

    response.enqueue(new Callback<ServerResponse>() {
        @Override
        public void onResponse(Call<ServerResponse> call, retrofit2.Response<ServerResponse> response) {
            ServerResponse resp = response.body();

            if (resp.getResult().equals(Constants.SUCCESS)) {
                goToSeekerUserhomeScreen();
            }

            progressDialog.dismiss();
            Snackbar.make(create_sprof_scrollview, resp.getMessage(), Snackbar.LENGTH_LONG).show();
        }

        @Override
        public void onFailure(Call<ServerResponse> call, Throwable t) {
            progressDialog.dismiss();
            Snackbar.make(create_sprof_scrollview, t.getLocalizedMessage(), Snackbar.LENGTH_LONG).show();
        }
    });
}

From source file:com.ota.updates.activities.MainActivity.java

private void checkForUpdate() {
    final ProgressDialog loadingDialog = new ProgressDialog(mContext);
    loadingDialog.setIndeterminate(true);
    loadingDialog.setCancelable(false);//from ww  w  .j av  a2  s  . c o m
    loadingDialog.setMessage(mContext.getResources().getString(R.string.loading));
    loadingDialog.show();

    new DownloadJson(mContext, new AsyncResponse() {
        @Override
        public void processFinish(Boolean output) {
            if (output) {
                new ParseJson(mContext, new AsyncResponse() {
                    @Override
                    public void processFinish(Boolean output) {
                        if (output) {
                            new CheckForUpdate(mContext, new AsyncResponse() {
                                @Override
                                public void processFinish(Boolean updateAvailability) {
                                    if (DEBUGGING) {
                                        Log.d(TAG, "Update availability is " + updateAvailability);
                                    }

                                    if (updateAvailability) {
                                        loadFragment(new AvailableFragment());
                                    } else {
                                        loadFragment(new CheckFragment());
                                    }

                                    String time = Utils.getTimeNow(mContext);
                                    Preferences.setUpdateLastChecked(mContext, time);

                                    loadingDialog.cancel();
                                }
                            }).execute();
                        } else {
                            loadingDialog.cancel();
                        }
                    }
                }).execute();
            } else {
                loadingDialog.cancel();
            }
        }
    }).execute();
}

From source file:com.dong.huang.imdemo.ui.SettingsFragment.java

void logout() {
    final ProgressDialog pd = new ProgressDialog(getActivity());
    String st = getResources().getString(R.string.Are_logged_out);
    pd.setMessage(st);
    pd.setCanceledOnTouchOutside(false);
    pd.show();/* w w w . j  a va2 s. c  o  m*/
    DemoHelper.getInstance().logout(false, 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) {
            getActivity().runOnUiThread(new Runnable() {

                @Override
                public void run() {
                    // TODO Auto-generated method stub
                    pd.dismiss();
                    Toast.makeText(getActivity(), "unbind devicetokens failed", Toast.LENGTH_SHORT).show();

                }
            });
        }
    });
}

From source file:com.nxt.yn.app.ui.SettingsFragment.java

void logout() {
    final ProgressDialog pd = new ProgressDialog(getActivity());
    String st = getResources().getString(R.string.Are_logged_out);
    pd.setMessage(st);
    pd.setCanceledOnTouchOutside(false);
    pd.show();/*ww  w  .  ja va2 s.c  o  m*/
    DemoHelper.getInstance().logout(false, new EMCallBack() {

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

                }
            });
        }

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

        }

        @Override
        public void onError(int code, String message) {
            getActivity().runOnUiThread(new Runnable() {

                @Override
                public void run() {
                    // TODO Auto-generated method stub
                    pd.dismiss();
                    Toast.makeText(getActivity(), "unbind devicetokens failed", Toast.LENGTH_SHORT).show();

                }
            });
        }
    });
}

From source file:org.cafemember.messenger.mytg.fragments.TransfareActivity.java

private void saveName() {
    if (!checkUserName(phoneField.getText().toString(), true)) {
        return;/*w  w w. jav a2s .  c  om*/
    }
    if (getContext() == null) {
        return;
    }
    String newName = phoneField.getText().toString();
    String amount = amountField.getText().toString();

    if (amount == null || amount.length() == 0) {
        showErrorAlert("    ");
        return;
    }
    int amountInt;
    try {
        amountInt = Integer.parseInt(amount);
    } catch (Exception e) {
        showErrorAlert("    ");
        return;
    }
    if (amountInt < 100) {
        showErrorAlert("     100 ");
        return;
    }
    int transfareType = 1;
    /*if(typeJoin.isChecked()){
    transfareType = 1;
    }
    else if(typeView.isChecked()){
    transfareType = 2;
    }*/
    final ProgressDialog progressDialog = new ProgressDialog(getContext());
    progressDialog.setMessage(LocaleController.getString("Loading", R.string.Loading));
    progressDialog.setCanceledOnTouchOutside(false);
    //        progressDialog.setCancelable(false);
    progressDialog.show();
    Commands.transfare(newName, amountInt, transfareType, new OnResponseReadyListener() {
        @Override
        public void OnResponseReady(boolean error, JSONObject data, String message) {
            progressDialog.dismiss();
            if (error) {
                showErrorAlert(message);
            } else {
                Toast.makeText(context, "  ?  ", Toast.LENGTH_SHORT)
                        .show();
                //                    finishFragment();
            }
        }
    });
}

From source file:com.easemob.chatui.activity.SettingsFragment.java

void logout() {
    final ProgressDialog pd = new ProgressDialog(getActivity());
    String st = getResources().getString(R.string.Are_logged_out);
    pd.setMessage(st);
    pd.setCanceledOnTouchOutside(false);
    pd.show();//w  w w .ja  v a  2  s . c  o  m
    BeewayApplication.getInstance().logout(new EMCallBack() {

        @Override
        public void onSuccess() {
            getActivity().runOnUiThread(new Runnable() {
                public void run() {
                    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) {

        }
    });
}

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

void logout() {
    final ProgressDialog pd = new ProgressDialog(getActivity());
    String st = getResources().getString(R.string.Are_logged_out);
    pd.setMessage(st);
    pd.setCanceledOnTouchOutside(false);
    pd.show();//from  w w w.j  a va  2  s.  c  o  m
    DemoApplication.getInstance().logout(new EMCallBack() {

        @Override
        public void onSuccess() {
            getActivity().runOnUiThread(new Runnable() {
                @Override
                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.youti.chat.activity.SettingsFragment.java

void logout() {
    final ProgressDialog pd = new ProgressDialog(getActivity());
    String st = getResources().getString(R.string.Are_logged_out);
    pd.setMessage(st);
    pd.setCanceledOnTouchOutside(false);
    pd.show();/*from   ww  w .  ja v  a 2 s.co  m*/
    YoutiApplication.getInstance().logout(new EMCallBack() {

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

                }
            });
        }

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

        }

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

        }
    });
}