• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get distinct raw contact id

 
goel swati
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to get distinct raw contact id using content resolver.


Cursor cursor = getContentResolver().query(Data.CONTENT_URI, null, null, null, null);

in this query, 3rd parameter is selection. by passing null we will get all rows.

but i want rows with unique raw contact id.

what should i pass in selection.

Waiting for reply.

 
Ankit Garg
Sheriff
Posts: 9577
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try the Contacts content provider instead of Data provider...
 
goel swati
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hv to extract data from data table. that's y i m using URI of data table.

my data table consists of...

Mimetype_id Raw_Contact_id Data1
6 1 Name
6 2 Name
6 3 Name
6 4 Name
5 4 Ph. Number
5 3 Ph. Number
5 2 Ph. Number
5 1 Ph. Number

Now I have to find out the cursor.

And display the details in list view as following....

Name
Ph. Number
Name
Ph. Number

and so on...

In list view, each row consists of 2 text views.
first text view should contains the name of the person and the 2nd text view should contains the phone number of that person.


Waiting for reply........
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic