Reputation: 3684
I have problem, I don't know how to get LastOutgoingCall
from android.provider.CallLog.Calls
. There is a public method getLastOutgoingCall
but I don't know how to accces it.
I can create object CallLog.Calls
but there is no such method like getLastOutgoingCall
.
I know there is "Query the call log database for the last dialed number" but have no idea how to get and use it. For any tips and answers, thanks in advance.
Upvotes: 2
Views: 1052
Reputation: 425
String lastDialed = CallLog.Calls.getLastOutgoingCall(getApplicationContext());
and of course add the permission to the manifest
<uses-permission android:name="android.permission.READ_CALL_LOG" />
Upvotes: 3
Reputation: 3578
Use content provider to get list of outgoing calls and arrange them in DESC order according to time and retrieve the first value of cursor.
Do some research to work on Content Provider.
Upvotes: 1