This may be a silly question, I'm a bit of a noob. I was reading this post: How do I access call log for android?
and in the answer at the bottom of the code they have this line:
int type = Integer.parseInt(c.getString(c.getColumnIndex(CallLog.Calls.TYPE)));// for call type, Incoming or out going
I'm a little confused as to how the call type is stored, is it as a string or as an integer? The line of code shown makes me think its saved as a number, but in string format. Can anyone explain this to me?
Thanks, Matt
The type is stored as integer. This is how I get a list of new missed calls:
cursor = cr.query(Uri.parse("content://call_log/calls"), null, "type = 3 AND new = 1", null, "date DESC");
Of course using the CallLog.Calls.MISSED_TYPE, INCOMING_TYPE and OUTGOING_TYPE constant would be better.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With