Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've struggled with this same problem for quite a while. Here is how I got it solved, take a look at this part of the documentation:</p> <blockquote> <p>A dialog is always created and displayed as a part of an Activity. You should normally create dialogs from within your Activity's onCreateDialog(int) callback method. When you use this callback, the Android system automatically manages the state of each dialog and hooks them to the Activity, effectively making it the "owner" of each dialog</p> <p>Note: If you decide to create a dialog outside of the onCreateDialog() method, it will not be attached to an Activity. You can, however, attach it to an Activity with setOwnerActivity(Activity).</p> </blockquote> <p><strong>from:</strong> <a href="http://developer.android.com/guide/topics/ui/dialogs.html#ShowingADialog" rel="nofollow">http://developer.android.com/guide/topics/ui/dialogs.html#ShowingADialog</a></p> <p>This is an example of what you have to set on <strong>your activity:</strong></p> <pre><code> @Override protected void onPrepareDialog(int id, Dialog dialog) { //This doesn't do anything if (id == DIALOG_PROGRESS_ID) { ((ProgressDialog)dialog).setIndeterminate(true); } super.onPrepareDialog(id, dialog); } @Override protected Dialog onCreateDialog(int id) { if (id == DIALOG_PROGRESS_ID) { ProgressDialog dialog = new ProgressDialog(this); dialog.setMessage("Loading"); dialog.setCancelable(false); dialog.setIndeterminate(true); return dialog; } return null; } </code></pre> <p>You can then call <code>myActivity.showDialog(myActivity.DIALOG_PROGRESS_ID)</code>, <code>myActivity.dismissDialog(myActivity.DIALOG_PROGRESS_ID)</code> from any where as long as you have a reference to your activity instance.</p>
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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