Javatpoint Logo
Javatpoint Logo

Android Call State Example

We can also get the information of call state using the TelephonyManager class. For this purpose, we need to call the listen method of TelephonyManager class by passing the PhonStateListener instance.

The PhoneStateListener interface must be implemented to get the call state. It provides one method onCallStateChanged().

Android Call State Example

Let's see the example, where we are determining whether phone is ringing or phone is in a call or phone is neither ringing nor in a call.


In this example, we don't have any component in this file..

Activity class

Let's write the code to know the call state.



You need to provide READ_PHONE_STATE permission in the AndroidManifest.xml file.

File: AndroidManifest.xml

android call state example output 1 android call state example output 2

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA