listview - How to get value of Variable[position] in BaseAdapter class - Android -


i have baseadapter class uses variables

listcomments[position]; listusernames[position]; 

how find actual value of these variables? have tried making "if statement" this, doesn't work.

   if (listcomments[position] != "null"){  //do  } 

i trying see if variable equal null doesn't work. believe because listcomments[position]; not comparing variable value @ position. how can compare value of actual variable @ position "null"?

instead of writing

if (listcomments[position] != "null"){  //do  } 

write below:

if (!listcomments[position].equalsignorecase("")){  //do  } 

edit: had forgotten put "!" @ start of condition. edited.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -