I am in this dialog box to set up a ListView. When I checked one of these one time , it will close the dialog, but AlertDialog.Builder dialog box does not like finish () or dismiss () in such a way .
how to close this dialog box does ?
------ Solution ---------------------------------------- ----
you use removeDialog (id) on the line
------ Solution ------------------------- -------------------
the landlord of the students :
You can use OnItemSelectedListener listen ListView, and then call the Activity removeDialog ( before you use showDialog (id) the id) to remove the dialog from memory ; If you use dismissDialog (id), then just let it temporarily hidden, it is still in memory. As I hope you can answer a role.
you said that dismiss () method is the Dialog own methods. Generally, we only use the Activity removeDialog (id) method to achieve the functionality you stated .
------ Solution ---------------------------------------- ----
AlertDialog.Builder builder = new AlertDialog.Builder (this);
Dialog dialog = builder.show ();
dialog.dismiss ();
------ eference ------------------------------ ---------
listen ah ...... monitor this action you select an item , then you can do what you want to do the thing the
------ eference --- ------------------------------------
Yes, I listen a listView click on the action, but I done their own thing and would like to put this dialog box closes , and which method to use to close it . AlertDialog.Builder class, have closed their own way?
------ eference --------------------------------------- < br> AlertDialog.Builder this class is only used for generating AlertDialog object , namely Builder pattern , which naturally does not have a closing AlertDialog way to go. Close approach is to inherit the parent class method dismiss ();
------ eference --------------------------- ------------
dismiss it.
------ eference --------------------------------------- < br> you can answer me , I'm happy ,
But before you can understand Do not give me the wrong answer ah.
AlertDialog.Builder not dismiss the class methods .
------ eference --------------------------------------- < br> Thank you, 7th floor , I also used this idea to your .
8 building methods have not tried , so I try, then you can stick to the junction points.
------ eference --------------------------------------- < br> Will the landlord removeDialog (id) is not specified in the id come id ah
------ eference ------------------ ---------------------
force top 8th floor possiblity o (∩ _ ∩) o
------ eference - --------------------------------------
share will not solve the problem ?
------ eference --------------------------------------- < br> force top 8th floor , the method so.
------ eference --------------------------------------- < br> 8 floor, it is the positive solution , the top eighth
没有评论:
发表评论