There's an activity in my application. It contains a button. By clicking the button it should be start PhoneStateListener (and BroadcastReceiver?) to catch incoming and outgoing calls. It seems it should be a service.
Does anyone can explain how to start PhoneStateListener (and BroadcastReceiver?) programmatically?
Try this:
you have to used this code and it is 100% work.
(1) you have to start services
(2) you have to make CallServices class and start your contentobser.
}
(3) make CustomContentObserver class to getting you to call log.
}
}
in this way you have to read call log data. i am using content Observer because of in htc device can not read phonestateListner that's way.