I have added a Inside this, a text is entered in Try inside However, the dialog is still being dismissed, though I can There is no way to cancel the dismissal inside I have found a custom dialog to resolve this problem. Hope for you that this will help you. DialogFragment I only have one
EditText And accept and cancel button.
EditText ; So, when clicking on accept, the text is checked using the
try / catch .
, if everything goes well, then I reject the dialogue; If the flow enters
hold , then this idea is to maintain the dialogue and not to dismiss it, so that the user can get an opportunity to correct the text.
@Override public dialog on crude digital (bundle saved instenstate) {... builder.setPositiveButton (android.R.string.ok, New OnClickListener) {Click Public Zero ( DialogInterface dialogue, int id) {onAcceptDialog ();}}) ...}. .. acceptance on private zeros () (try {... this.dismiss ();} hold (exception e) {... // dialog is still being rejected, though it should not be}}
this.dismiss () inside
hold .
onAcceptDialog () ?
@ Override Protected Dialogue on Create Dialogue (Int ID) {Final AlertDialog.Bloulder Warning = New AlertDialog Builder (this); alert.setTitle ("Test"); alert.setIcon (R.drawable.logo1) ; Alert.setMessage ("Customer service is dedicated to company." LinearLayout Leila 1 = new linerlayout (this); linear line linbuttons = new linear line (this); linbuttons.setOrientation (LinearLayout.HORIZONTAL); button btnPositive = new button ); Button btnNegative = New button (this); btnPositive.setText ("Send"); Write your code to send to BtnPositive.setOnClickListener (New OnClickListener () {@Override Public Zero (see V) {//) BckPressed ();}}); BtnNegative.setText ("Cancel"); Click on BtnNegative.setOnClickListener (New OnClickListener) {@Override Public Zero (see V) {onBackpressed ();}}); Linbuttons.addView (btnPositive); Linbuttons.addView (btnNegative); Lila1.addView (linbuttons); Return warning. Create (); }}
No comments:
Post a Comment