Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
import android.content.ContentResolver; import android.provider.CallLog; import android.database.Cursor; import android.net.Uri; /* Get the content resolver to access call log */ ContentResolver resolver = context.getContentResolver(); /* Query the call log for missed calls, sorted by date descending */ Uri callLogUri = CallLog.Calls.CONTENT_URI; String selection = CallLog.Calls.TYPE + " = ?"; String[] selectionArgs = new String[] { String.valueOf(CallLog.Calls.MISSED_TYPE) }; String sortOrder = CallLog.Calls.DATE + " DESC"; Cursor cursor = resolver.query(callLogUri, null, selection, selectionArgs, sortOrder); /* Check if there are any missed calls */ if (cursor != null && cursor.moveToFirst()) { /* Get the ID of the most recent missed call */ int idIndex = cursor.getColumnIndex(CallLog.Calls._ID); String callId = cursor.getString(idIndex); /* Delete the missed call entry */ Uri deleteUri = Uri.withAppendedPath(CallLog.Calls.CONTENT_URI, callId); resolver.delete(deleteUri, null, null); cursor.close(); }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)