List of usage examples for android.app ProgressDialog dismiss
@Override public void dismiss()
From source file:com.dedipower.portal.android.ManagedServerLanding.java
public void onCreate(Bundle savedInstanceState) { API.SessionID = getIntent().getStringExtra("sessionid"); super.onCreate(savedInstanceState); setContentView(R.layout.managedserverlanding); //temp/* www .j ava2s .c om*/ list = (ListView) findViewById(R.id.ManagedServerList); final ProgressDialog dialog = ProgressDialog.show(this, "DediPortal", "Please wait: loading data....", true); final Handler handler = new Handler() { public void handleMessage(Message msg) { dialog.dismiss(); if (Success.equals("true")) { UpdateErrorMessage(ErrorMessage); ManagedServerAdaptor adapter = new ManagedServerAdaptor(ManagedServerLanding.this, listOfManagedServers, API.SessionID); list.setAdapter(adapter); } else { UpdateErrorMessage(ErrorMessage); } } }; Thread dataPreload = new Thread() { int ServerCount = 0; public void run() { try { Servers = API.PortalQuery("servers", "none"); Success = Servers.getString("success"); } catch (JSONException e) { //UpdateErrorMessage("An unrecoverable JSON Exception occured."); ErrorMessage = "An unrecoverable JSON Exception occured."; } if (Success.equals("false")) { try { //UpdateErrorMessage(Servers.getString("msg")); ErrorMessage = Servers.getString("msg"); } catch (JSONException e) { //UpdateErrorMessage("An unrecoverable JSON Exception occured."); ErrorMessage = "An unrecoverable JSON Exception occured."; } } else { Log.i("APIFuncs", Servers.toString()); try { ManagedServers = Servers.getJSONArray("servers"); //UpdateErrorMessage(""); ErrorMessage = ""; } catch (JSONException e) { //UpdateErrorMessage("There are no Managed servers in your account."); ErrorMessage = "There are no Managed servers in your account."; } try { ServerCount = ManagedServers.length(); } catch (Exception e) { ServerCount = 0; } if (ServerCount == 0) { ErrorMessage = "There are no Managed servers for your account."; handler.sendEmptyMessage(0); return; } for (int i = 0; i < ServerCount; i++) { try { CurrentServer = ManagedServers.getJSONObject(i).getJSONObject("Server"); } catch (JSONException e1) { Log.e("APIFuncs", e1.getMessage()); } //Log.e("APIFuncs",CurrentServer.toString(3)); listOfManagedServers.add(new ManagedServer(GetString("ip"), GetString("servercode"), GetString("description"), GetString("facility"), GetInt("bandwidth"), GetString("bandwidthTotal"), GetBool("monitored"), GetInt("transferlimit"), GetString("software"), GetString("state"), GetBool("managedbackupenabled"))); } } handler.sendEmptyMessage(0); } }; dataPreload.start(); //temp /*try { Servers = API.PortalQuery("servers", "none"); Success = Servers.getString("success"); } catch (JSONException e) { UpdateErrorMessage("An unrecoverable JSON Exception occured."); } if(Success == "false") { try { UpdateErrorMessage(Servers.getString("msg")); } catch (JSONException e) { UpdateErrorMessage("An unrecoverable JSON Exception occured."); } } else { Log.i("APIFuncs",Servers.toString()); try { ManagedServers = Servers.getJSONArray("servers"); UpdateErrorMessage(""); } catch (JSONException e) { UpdateErrorMessage("There are no Managed servers in your account."); } //OK lets actually do something useful ListView list = (ListView)findViewById(R.id.ManagedServerList); List<ManagedServer> listOfManagedServers = new ArrayList<ManagedServer>(); int ServerCount = ManagedServers.length(); for(int i = 0; i < ServerCount; i++) { try { CurrentServer = ManagedServers.getJSONObject(i).getJSONObject("Server"); } catch (JSONException e1) { Log.e("APIFuncs",e1.getMessage()); } //Log.e("APIFuncs",CurrentServer.toString(3)); listOfManagedServers.add(new ManagedServer(GetString("ip"), GetString("servercode"), GetString("description"), GetString("facility"), GetInt("bandwidth"), GetString("bandwidthTotal"), GetBool("monitored"), GetInt("transferlimit"), GetString("software"), GetString("state"), GetBool("managedbackupenabled"))); } ManagedServerAdaptor adapter = new ManagedServerAdaptor(this, listOfManagedServers, API.SessionID); list.setAdapter(adapter); }*/ }
From source file:com.tpb.projects.repo.fragments.RepoInfoFragment.java
@OnClick({ R.id.repo_license, R.id.repo_license_drawable, R.id.repo_license_text }) void showLicense() { if (mRepo.hasLicense()) { final ProgressDialog pd = new ProgressDialog(getContext()); pd.setTitle(R.string.title_loading_license); pd.setMessage(mRepo.getLicenseName()); pd.show();/*from ww w . ja v a 2 s . c om*/ mLoader.loadLicenseBody(new Loader.ItemLoader<String>() { @Override public void loadComplete(String data) { pd.dismiss(); new AlertDialog.Builder(getContext()).setTitle(mRepo.getLicenseName()).setMessage(data) .setPositiveButton(R.string.action_ok, null).create().show(); } @Override public void loadError(APIHandler.APIError error) { pd.dismiss(); Toast.makeText(getContext(), R.string.error_loading_license, Toast.LENGTH_SHORT).show(); } }, mRepo.getLicenseUrl()); } }
From source file:com.dedipower.portal.android.ViewTicket.java
public void onCreate(Bundle savedInstanceState) { API.SessionID = getIntent().getStringExtra("sessionid"); super.onCreate(savedInstanceState); setContentView(R.layout.viewticket); list = (ListView) findViewById(R.id.TicketUpdatesList); final ProgressDialog dialog = ProgressDialog.show(this, "DediPortal", "Please wait: loading data....", true);/* w ww . j a v a 2 s .co m*/ final Handler handler = new Handler() { public void handleMessage(Message msg) { dialog.dismiss(); if (Success.equals("true")) { UpdateErrorMessage(ErrorMessage); TicketUpdatesAdaptor adapter = new TicketUpdatesAdaptor(ViewTicket.this, listOfUpdates, API.SessionID); list.setAdapter(adapter); } else { UpdateErrorMessage(ErrorMessage); } } }; Thread dataPreload = new Thread() { public void run() { try { TicketAPI = API.PortalQuery("updates", getIntent().getStringExtra("ticketID")); Success = TicketAPI.getString("success"); } catch (JSONException e) { ErrorMessage = "An unrecoverable JSON Exception occured. Error Code: 1"; Log.e("APIFuncs", e.getMessage()); } if (Success == "false") { try { Log.i("APIFuncs", TicketAPI.toString(3)); ErrorMessage = TicketAPI.getString("msg"); } catch (JSONException e) { Log.e("APIFuncs", e.getMessage()); } } else { Log.i("APIFuncs", TicketAPI.toString()); try { Updates = TicketAPI.getJSONArray("updates"); ErrorMessage = ""; } catch (JSONException e) { ErrorMessage = "There are no updates for this ticket. (Strange!)"; } int TicketCount = Updates.length(); if (TicketCount == 0) { ErrorMessage = "There are no updates for this ticket."; return; } for (int i = 0; i < TicketCount; i++) { try { CurrentTicket = Updates.getJSONObject(i); } catch (JSONException e1) { Log.e("APIFuncs", e1.getMessage()); } if (CurrentTicket != null) { listOfUpdates.add(new TicketUpdates(GetString("type"), GetString("name"), GetInt("time"), GetString("content"))); } } handler.sendEmptyMessage(0); } } }; dataPreload.start(); Button AddReply = (Button) findViewById(R.id.AddReplyButton); AddReply.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent CreateTicketReplyIntent = new Intent(ViewTicket.this, AddTicketReply.class); CreateTicketReplyIntent.putExtra("sessionid", API.SessionID); CreateTicketReplyIntent.putExtra("ticketid", getIntent().getStringExtra("ticketID")); ViewTicket.this.startActivity(CreateTicketReplyIntent); } }); /* try { TicketAPI = API.PortalQuery("updates", getIntent().getStringExtra("ticketID")); Success = TicketAPI.getString("success"); } catch (JSONException e) { UpdateErrorMessage("An unrecoverable JSON Exception occured. Error Code: 1"); Log.e("APIFuncs",e.getMessage()); //Toast.makeText(ColoLanding.this, "An unrecoverable JSON Exception occured.", Toast.LENGTH_LONG).show(); } if(Success == "false") { try { Log.i("APIFuncs",TicketAPI.toString(3)); UpdateErrorMessage(TicketAPI.getString("msg")); } catch (JSONException e) { Log.e("APIFuncs",e.getMessage()); UpdateErrorMessage("An unrecoverable JSON Exception occured. Error Code: 2"); } } else { Log.i("APIFuncs",TicketAPI.toString()); try { Updates = TicketAPI.getJSONArray("updates"); UpdateErrorMessage(""); } catch (JSONException e) { UpdateErrorMessage("There are no updates for this ticket. (Strange!)"); } //OK lets actually do something useful List<TicketUpdates> listOfUpdates = new ArrayList<TicketUpdates>(); int TicketCount = Updates.length(); if(TicketCount == 0) { UpdateErrorMessage("There are no updates for this ticket."); return; } for(int i = 0; i < TicketCount; i++) { try { CurrentTicket = Updates.getJSONObject(i); } catch (JSONException e1) { Log.e("APIFuncs",e1.getMessage()); } if(CurrentTicket != null) { listOfUpdates.add(new TicketUpdates(GetString("type"), GetString("name"), GetInt("time"), GetString("content"))); } } TicketUpdatesAdaptor adapter = new TicketUpdatesAdaptor(this, listOfUpdates, API.SessionID); list.setAdapter(adapter); }*/ }
From source file:net.networksaremadeofstring.pulsant.portal.ViewTicket.java
public void onCreate(Bundle savedInstanceState) { API.SessionID = getIntent().getStringExtra("sessionid"); super.onCreate(savedInstanceState); setContentView(R.layout.viewticket); list = (ListView) findViewById(R.id.TicketUpdatesList); final ProgressDialog dialog = ProgressDialog.show(this, "Pulsant Portal", "Please wait: loading data....", true);/*w w w . j a v a 2s .co m*/ final Handler handler = new Handler() { public void handleMessage(Message msg) { dialog.dismiss(); if (Success.equals("true")) { UpdateErrorMessage(ErrorMessage); TicketUpdatesAdaptor adapter = new TicketUpdatesAdaptor(ViewTicket.this, listOfUpdates, API.SessionID); list.setAdapter(adapter); } else { UpdateErrorMessage(ErrorMessage); } } }; Thread dataPreload = new Thread() { public void run() { try { TicketAPI = API.PortalQuery("updates", getIntent().getStringExtra("ticketID")); Success = TicketAPI.getString("success"); } catch (JSONException e) { ErrorMessage = "An unrecoverable JSON Exception occured. Error Code: 1"; Log.e("APIFuncs", e.getMessage()); } if (Success.equals("false")) { try { Log.i("APIFuncs", TicketAPI.toString(3)); ErrorMessage = TicketAPI.getString("msg"); } catch (JSONException e) { ErrorMessage = e.getMessage(); Log.e("APIFuncs", e.getMessage()); } handler.sendEmptyMessage(0); } else { Log.i("APIFuncs", TicketAPI.toString()); try { Updates = TicketAPI.getJSONArray("updates"); ErrorMessage = ""; } catch (JSONException e) { ErrorMessage = "There are no updates for this ticket. (Strange!)"; } int TicketCount = Updates.length(); if (TicketCount == 0) { ErrorMessage = "There are no updates for this ticket."; return; } for (int i = 0; i < TicketCount; i++) { try { CurrentTicket = Updates.getJSONObject(i); } catch (JSONException e1) { Log.e("APIFuncs", e1.getMessage()); } if (CurrentTicket != null) { listOfUpdates.add(new TicketUpdates(GetString("type"), GetString("name"), GetInt("time"), GetString("content"))); } } handler.sendEmptyMessage(0); } } }; dataPreload.start(); Button AddReply = (Button) findViewById(R.id.AddReplyButton); AddReply.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent CreateTicketReplyIntent = new Intent(ViewTicket.this, AddTicketReply.class); CreateTicketReplyIntent.putExtra("sessionid", API.SessionID); CreateTicketReplyIntent.putExtra("ticketid", getIntent().getStringExtra("ticketID")); ViewTicket.this.startActivity(CreateTicketReplyIntent); } }); /* try { TicketAPI = API.PortalQuery("updates", getIntent().getStringExtra("ticketID")); Success = TicketAPI.getString("success"); } catch (JSONException e) { UpdateErrorMessage("An unrecoverable JSON Exception occured. Error Code: 1"); Log.e("APIFuncs",e.getMessage()); //Toast.makeText(ColoLanding.this, "An unrecoverable JSON Exception occured.", Toast.LENGTH_LONG).show(); } if(Success == "false") { try { Log.i("APIFuncs",TicketAPI.toString(3)); UpdateErrorMessage(TicketAPI.getString("msg")); } catch (JSONException e) { Log.e("APIFuncs",e.getMessage()); UpdateErrorMessage("An unrecoverable JSON Exception occured. Error Code: 2"); } } else { Log.i("APIFuncs",TicketAPI.toString()); try { Updates = TicketAPI.getJSONArray("updates"); UpdateErrorMessage(""); } catch (JSONException e) { UpdateErrorMessage("There are no updates for this ticket. (Strange!)"); } //OK lets actually do something useful List<TicketUpdates> listOfUpdates = new ArrayList<TicketUpdates>(); int TicketCount = Updates.length(); if(TicketCount == 0) { UpdateErrorMessage("There are no updates for this ticket."); return; } for(int i = 0; i < TicketCount; i++) { try { CurrentTicket = Updates.getJSONObject(i); } catch (JSONException e1) { Log.e("APIFuncs",e1.getMessage()); } if(CurrentTicket != null) { listOfUpdates.add(new TicketUpdates(GetString("type"), GetString("name"), GetInt("time"), GetString("content"))); } } TicketUpdatesAdaptor adapter = new TicketUpdatesAdaptor(this, listOfUpdates, API.SessionID); list.setAdapter(adapter); }*/ }
From source file:net.networksaremadeofstring.pulsant.portal.ColoLanding.java
public void onCreate(Bundle savedInstanceState) { API.SessionID = getIntent().getStringExtra("sessionid"); super.onCreate(savedInstanceState); setContentView(R.layout.cololanding); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setTitle("Colocation"); detailsdialog = new Dialog(this); EditHandler = new Handler() { public void handleMessage(Message msg) { if (msg.what == 0) { Toast.makeText(ColoLanding.this, "Description updated successfully!", Toast.LENGTH_SHORT) .show();//from ww w . j a v a 2s . c o m } else { Toast.makeText(ColoLanding.this, "There was an error updating that description", Toast.LENGTH_SHORT).show(); } } }; //Temp list = (ListView) findViewById(R.id.ColoCabList); final ProgressDialog dialog = ProgressDialog.show(this, "Pulsant Portal", "Please wait: loading data....", true); final Handler handler = new Handler() { public void handleMessage(Message msg) { dialog.dismiss(); if (Success.equals("true")) { UpdateErrorMessage(ErrorMessage); adapter = new ColoRacksAdaptor(ColoLanding.this, listOfColoRacks); list.setAdapter(adapter); list.setChoiceMode(ListView.CHOICE_MODE_SINGLE); } else { UpdateErrorMessage(ErrorMessage); } } }; Thread dataPreload = new Thread() { public void run() { try { Colo = API.PortalQuery("colocation", "none"); Success = Colo.getString("success"); } catch (JSONException e) { ErrorMessage = "An unrecoverable JSON Exception occurred."; //UpdateErrorMessage("An unrecoverable JSON Exception occurred."); } if (Success.equals("false")) { try { //UpdateErrorMessage(Colo.getString("msg")); ErrorMessage = Colo.getString("msg"); } catch (JSONException e) { ErrorMessage = "An unrecoverable JSON Exception occured."; //UpdateErrorMessage("An unrecoverable JSON Exception occured."); } } else { Log.i("APIFuncs", Colo.toString()); try { ColoCabs = Colo.getJSONArray("colocation"); ErrorMessage = ""; //UpdateErrorMessage(""); } catch (JSONException e) { ErrorMessage = "There are no Co-Location Cabinets in your account."; //UpdateErrorMessage("There are no Co-Location Cabinets in your account."); } int ColoCount = ColoCabs.length(); if (ColoCount == 0) { //UpdateErrorMessage("There are no colocation cabinets for your account."); ErrorMessage = "There are no colocation cabinets for your account."; handler.sendEmptyMessage(0); return; } for (int i = 0; i < ColoCount; i++) { JSONObject CurrentColo = null; try { CurrentColo = ColoCabs.getJSONObject(i); } catch (JSONException e1) { Log.e("APIFuncs", e1.getMessage()); } try { listOfColoRacks.add(new ColoRacks(CurrentColo.getString("ip"), CurrentColo.getString("servercode"), CurrentColo.getString("facility"), CurrentColo.getInt("bandwidth"), CurrentColo.getString("bandwidthTotal"), CurrentColo.getInt("transferlimit"), CurrentColo.getString("state"), CurrentColo.getString("description"))); } catch (JSONException e) { Log.e("APIFuncs", e.getMessage()); } } } handler.sendEmptyMessage(0); } }; dataPreload.start(); }
From source file:com.wenwen.chatuidemo.activity.PersonFragment.java
void logout() { final ProgressDialog pd = new ProgressDialog(getActivity()); pd.setMessage(".."); pd.setCanceledOnTouchOutside(false); pd.show();//from ww w . j a v a 2 s.c om 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:org.dash.wallet.integration.uphold.ui.UpholdWithdrawalDialog.java
private void transfer(BigDecimal value, final boolean deductFeeFromAmount) { final ProgressDialog progressDialog = showLoading(); UpholdClient.getInstance().createDashWithdrawalTransaction(value.toPlainString(), receivingAddress, new UpholdClient.Callback<UpholdTransaction>() { @Override//from www . ja v a 2 s . co m public void onSuccess(UpholdTransaction tx) { transaction = tx; progressDialog.dismiss(); showCommitTransactionConfirmationDialog(deductFeeFromAmount); } @Override public void onError(Exception e, boolean otpRequired) { progressDialog.dismiss(); if (otpRequired) { showOtpDialog(); } else { showLoadingError(); } } }); }
From source file:com.feytuo.chat.activity.ContactlistFragment.java
/** * ?// w w w.j av a2 s . 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:org.dash.wallet.integration.uphold.ui.UpholdWithdrawalDialog.java
private void commitTransaction() { final ProgressDialog progressDialog = showLoading(); final String txId = transaction.getId(); UpholdClient.getInstance().commitTransaction(txId, new UpholdClient.Callback<Object>() { @Override/*from w ww . j a va2 s . c o m*/ public void onSuccess(Object data) { if (onTransferListener != null) { onTransferListener.onTransfer(); } progressDialog.dismiss(); showSuccessDialog(txId); } @Override public void onError(Exception e, boolean otpRequired) { progressDialog.dismiss(); if (otpRequired) { showOtpDialog(); } else { showLoadingError(); } } }); }
From source file:com.qddagu.app.meetreader.ui.MainActivity.java
/** * ?//from ww w. j a v a 2s . c om * @param handler */ public void loadMeeting(final String url) { final ProgressDialog mLoadingDialog = new ProgressDialog(this); mLoadingDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); mLoadingDialog.setTitle("??"); mLoadingDialog.setMessage("??..."); mLoadingDialog.setCancelable(false); mLoadingDialog.show(); final Handler handler = new Handler() { @Override public void handleMessage(Message msg) { mLoadingDialog.dismiss(); if (msg.what == 1) { //? Meeting meeting = ((Meeting) msg.obj); User user = meeting.getUser(); if (user != null) { //?? appContext.saveUserInfo(user); } appContext.setMeeting(meeting);//? appContext.saveHistory(meeting);//?? UIHelper.showMeeting(MainActivity.this); } else if (msg.what == 0) { // UIHelper.ToastMessage(MainActivity.this, ""); } else if (msg.what == -1 && msg.obj != null) { ((AppException) msg.obj).makeToast(MainActivity.this); } } }; new Thread() { public void run() { Message msg = new Message(); try { Meeting meeting = appContext.getMeeting(url); msg.what = (meeting != null && meeting.getId() > 0) ? 1 : 0; msg.obj = meeting; } catch (AppException e) { e.printStackTrace(); msg.what = -1; msg.obj = e; } handler.sendMessage(msg); } }.start(); }