Friday 15 January 2010

android - Dialog to open another dialog -


I want to follow up with a dialog if a person responds to a question with a dialog, then a specific answer Chooses.

In this example, if the person selects 'Choice 1' then another dialogue will open to ask more questions.

I have the following partial code:

  Private Zero openDialog1 () {AlertDialog.Builder Builder = New AlertDialog.Builder (getActivity ()); Builder.setTitle ("Select"); String final string = ""; If ((ChoiceLists.listofchoices [item]] [syn: (), .equals ("choice 1")) || (ChoiceLists.listofchoices [item] .equals ("Choice2"))) {openDialog2 ();} TextView Tv1 = (TextView) getActivity () FindViewById (R.id.tv1); Last String = Choice List.strew [Item]; If the result ({. Object ("") // // is a global value, {final string = final string + "-" + RESULT; RESULT = "";} tv1.setText (TV1 .gettext () + Ultimate String + "\ n");}}); Dialog1 = builder.create (); Dialog1.show (); } Private Zero openDialog2 () {layoutinfoletters = layoutInflater. From (getActivity ()); See Promptview = li.inflate (R.layout.reward_detail_prompt, null); AlertDialog.builder Builder = New AlertDialog.Builder (getActivity ()); Builder.setView (promptView); Last edit textUser input = (Editable text) QuickviewFindvibid (RID.tarwarddell); Builder.setCancelable (wrong); Builder.setPositiveButton ("OK", New DialogInterface.OnClickListener () {Click Public Zero (DialogInterface dialogue, int id) {RESULT = userInput.getText (). ToString ();}}); Builder.setNegativeButton ("Cancel", New DialogInterface.OnClickListener () {Click on Public Zero (DialogInterface dialogue, int) {RESULT = ""; // Results are global values}}); }   

If I can not do it like this how would you go about doing this? Thanks in advance. I am moving forward to learn more about this ... thanks for all help

Complete your second method

  Private Zero openDialog2 () {... builder.create (). Show (); }    

No comments:

Post a Comment