Question

I am developing an application in which I am storing call log details from CallLog provider.

Android stores call logs in a database and I am copying new rows from that database.

Now I want to copy call details when the user ends a call. For that I have used the PhoneStateListener with which I listen for state ringing, off hook and idle mode but after the call is ended the idle method calls more than once, so I cannot use that.

Second I used ContentObserver for call log table and it gives me onChanged event when Android inserts call details in it and at that time I copy those details into my database.

Is it that the proper way to use ContentObserver? Is there any other way to get details of new calls which is just ended?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top