I have a textview in my application and want to check whether the properties of text on my textview has a value or null. Then i want to set the display to "there's nothing" if the value on my textview is null, or if it isn't then change the display to "there's something!"
but it changes the textview to "there's nothing" even if it's not!
this is my code :
mybutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mytextview != null){
mytextview.setText("there's nothing");
} else {
mytextview.setText("there's something!");
}
}
});
i think the problem is with this line:
if (mytextview != null){
Aucun commentaire:
Enregistrer un commentaire