android: what is the value of intent when nothing is put on? -


i have dialog pop in middle of program , user has to

specify between 2 options click confirm

problem arises when user selects nothing click confirm button

so need way notice user hasnt selected

and add check inside confrim button's click listener

im thinking of

.... .setpositivebutton("confirm", new dialoginterface.onclicklistener() {  @override public void onclick(dialoginterface dialog, int which) {     if (intent == null)      { //do nothing or tell user select on }    else      { gettargetfragment().onactivityresult(gettargetrequestcode(), activity.result_ok, i);}} 

of course intent == null doesnt work, code should use?

intent action name without extras not null. if want check extras there intent try following code

if (intent.getextras() == null) {   // if there not extras. } else {  } 

Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -