vendredi 17 avril 2015

android NullPointerException on checking null value

I am getting some data from server and setting the values in a getter and setter class. When the values seems to be null i am getting following values in my getter setter class



Tag [seatNo=null, Value=null, player1=null, player2=null, player3=null, player4=null, player5=null ]


The above value is been printed in Logcat


after getting above values i am checking an if condition because of which the app crashes



if (bet.getSeatNo() != null || !bet.getSeatNo().isEmpty() || !bet.getSeatNo().equals("null"))
{

}


how to check it is null or not ?


Aucun commentaire:

Enregistrer un commentaire