Android : Edittext.getText().toString() returning null

on Friday, October 31, 2014


i have an edittext field and when I am trying to use the toString to fill it in it seems like I am returning null. I'm using a toast to try to figure out the value of it. The edittext field is input from the softkeyboard.



String fav=disp_label.getText().toString();
Toast toast =Toast.makeText(this," "+fav+fav.length(),Toast.LENGTH_SHORT);
toast.show();


if i try adding



disp.setText(fav);


it still returns nothing


this is what i used to get an integer out of an edittext field which works correctly...is there something similar for a string?



channel=Integer.parseInt(disp.getText().toString());

0 comments:

Post a Comment