Android TextView getText() method -


suppose have declared textview username. , have not assign string username.settext() , before if called username.gettext() method, whats going return ??

it return null because nothing in there. .gettext() return text textview displaying.

i first check textview username not null following:

if (username.gettext() != null){  //textview not null  //do } 

i hope helpful you.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -