android - Java Arrays.asList(columnes).contains() return false -


in application have columnes variable data :

enter image description here

list<string> columnes = getsinglecolumn("id"); 

now i'm trying check single string array :

arrays.aslist(columnes).contains("1") 

this check allways return false

my full code:

    list<string> columnes = getsinglecolumn("id");     (int = 0; < jsonarray.length(); i++) {         jsonobject item = jsonarray.getjsonobject(i);          clist = new categories();         clist.id = integer.parseint(item.getstring(sv.field_category_id));         clist.title = item.getstring(sv.field_category_title);         clist.followers = item.getstring(sv.field_category_followers);         clist.type = item.getstring(sv.field_category_type);         clist.date = item.getstring(sv.field_category_date);         clist.imageurl = item.getstring(sv.field_category_image_url);          log.e("check : ", arrays.aslist(columnes).contains(clist.id+""));  } catch (jsonexception e) {  } 

arrays.aslist(list) returns list<list<string>> not list<string> contains method can not find string in list of list (from @task's answer).therefore change

log.e("check : ", arrays.aslist(columnes).contains(clist.id+"")); 

to

log.e("check : ", columnes.contains(string.valueof(clist.id))); 

and check value of clist.id as

log.e("clist id value: ", string.valueof(clist.id)); 

Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -