When a call ends, how can I be sure that I am querying the Call Log after the call information has been written to the database?

I am looking for the end of a call by using a BroadcastReceiver with an intent-filter on android.intent.action.PHONE_STATE , looking for the phone to go idle .

Any help on this would be appreciated.

Thanks

Edit
Report