Guest User

Untitled

a guest
Aug 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. how to update call logs through android applications
  2. Uri allCalls = Uri.parse("content://call_log/calls");
  3. Cursor c = managedQuery(allCalls, null, null, null, null);
  4.  
  5. if (c.moveToFirst()) {
  6. do{
  7. String callType = "";
  8. switch (Integer.parseInt(c.getString(
  9. c.getColumnIndex(Calls.TYPE))))
  10. {
  11. case 1: callType = "Incoming";
  12. break;
  13. case 2: callType = "Outgoing";
  14. break;
  15. case 3: callType = "Missed";
  16. }
  17.  
  18.  
  19. } while (c.moveToNext());
  20.  
  21.  
  22. }
  23.  
  24. ContentValues values=new ContentValues();
  25. values.put("name", "Unknown");
  26.  
  27. int k=getContentResolver().update(allCalls, values,null, null);
Add Comment
Please, Sign In to add comment