Skip to main content

Posts

Showing posts from September, 2013

Alert Dialog code snippets

    AlertDialog.Builder alert = new AlertDialog.Builder(AlarmActivity.this);         View view = LayoutInflater.from(getBaseContext()).inflate(                 R.layout.dialog_outofrange_values, null);         alert.setTitle(getString(R.string.invalid))                 .setIcon(android.R.drawable.ic_dialog_alert)                 .setMessage(getString(R.string.values_out_of_range))                 .setView(view).setNegativeButton(getString(R.string.ok), null)                 .show();

Progress Dialog Code Snippet

public ProgressDialog pro_dialog; public void progressDialog() {         pro_dialog = new ProgressDialog(this);         pro_dialog.setMessage("Loading");         pro_dialog.setCancelable(true);         pro_dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);         pro_dialog.show();     } For Dismissing the Progress Dialogue pro_dialog.dismiss();