java - i Want to get incoming number from call log , but Without repeating the number If the process is repeated for the same number -
this code return repeating number
cursor c = getapplicationcontext().getcontentresolver() .query(calllog.calls.content_uri, null, calllog.calls.type+" = ? ", new string[]{string.valueof(calllog.calls.incoming_type)}, calllog.calls.date + " desc"); listview numlistview = (listview) findviewbyid(r.id.list); callcursoradapter adapter = new callcursoradapter(this, c); numlistview.setadapter(adapter);
you can use hashset
remove duplicate value list. here example hashset.
does adding duplicate value hashset/hashmap replace previous value
in question can see how adding value in hashset. after adding value in hashset pass list adapter.
that's it...
Comments
Post a Comment