Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to open ProgressBar inside the alertDailog?
    primarykey
    data
    text
    <p>i m newcomer in android. i am faceing some trouble my Scenarios is -when i click button so open alertDailog and alertdailog have two button like send and cancel,when i click send button, i wanna to open a ProgressBar because send button have havy content, so take more time.</p> <p>i m using handler but not found any exact solution </p> <p>i m using this code</p> <p>btn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) {</p> <pre><code> handler.sendEmptyMessage(0); } }); alert = new Dialog(ProgramDetailActivity.this); alert.setContentView(R.layout.dialog_email); alert.setTitle(" Enter mail info"); alert.setCancelable(true); new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { finish(); } }; btnSend = (Button) alert.findViewById(R.id.btnsend); btnBack = (Button) alert.findViewById(R.id.btncancel); alert.show(); </code></pre> <p>btnSend.setOnClickListener(new View.OnClickListener() {</p> <pre><code> @SuppressWarnings("null") public void onClick(View v) { handler2.sendEmptyMessage(0); </code></pre> <p>// perform long opration progressDialog.dismiss();</p> <pre><code> toast=Toast.makeText(ProgramDetailActivity.this,"Mail has been sent Sucessfully!", </code></pre> <p>Toast.LENGTH_LONG); toast.show();</p> <p>} }</p> <p>private Handler handler2 = new Handler() { public void handleMessage(Message msg) { alert.hide(); alert.cancel(); alert.dismiss();</p> <pre><code>progressDialog = ProgressDialog.show(v.getContext(), "Email Sending", "Please wait..."); } }; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload