1

this my code but it 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);
Pavneet_Singh
  • 36,884
  • 5
  • 53
  • 68
Mahmoud Abu Alheja
  • 3,343
  • 2
  • 24
  • 41

1 Answers1

0

You can use Hashset to remove duplicate value from your list. Here is the example for hashSet.

Does adding a duplicate value to a HashSet/HashMap replace the previous value

in the question you can see how they are adding value in the Hashset. After adding value in the Hashset then pass this list your adapter.

That's it...

Vishal Chhodwani
  • 2,567
  • 5
  • 27
  • 40