android - Type mismatch: cannot convert from void to Integer -
i have t1 text view. want store value of t1 in variable getting "type mismatch: cannot convert void integer" error
integer res=t1.settext(integer.tostring(result))
;
you can use see value
t1.settext(integer.tostring(result)); string result= t1.gettext().tostring();
and if want alert result:
new alertdialog.builder(this) .settitle("result") .setmessage("this textview value : "+ result) .setpositivebutton(android.r.string.yes, new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { // can want when user press yes } }) .setnegativebutton(android.r.string.no, new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { // can want when user press no } }) .seticon(r.drawable.ic_dialog_alert) .show();
Comments
Post a Comment