Android - What does a dismissed call look like?

Go To StackoverFlow.com

0

I want my app to be able to tell whether a call was missed, or just dismissed (hitting the red end button when there is an incoming call).

Do I use the CallLog.Calls NEW constant?

2012-04-04 22:40
by user1313996
use content provider to access call lo - pleerock 2012-04-04 23:03
a little more help - user1313996 2012-04-04 23:17


0

in your manifest file add :

<uses-permission android:name="android.permission.READ_CONTACTS" />

and in your activity add:

Uri allCalls = Uri.parse("content://call_log/calls");

Cursor c = getContentResolver().query(allCalls, null,
                CallLog.Calls.NEW + " = ?", new String[] { "1" }, null);
c.moveToFirst();

String num= c.getString(c.getColumnIndex(CallLog.Calls.NUMBER));
String name= c.getString(c.getColumnIndex(CallLog.Calls.CACHED_NAME));
String duration = c.getString(c.getColumnIndex(CallLog.Calls.DURATION));
String type = c.getString(c.getColumnIndex(CallLog.Calls.TYPE));

Log.d("num", num);
Log.d("name", name);
Log.d("duration", duration);
Log.d("type", type);
2012-04-04 23:41
by pleerock
Ads