Call events in widget

Shay

Well-Known Member
Licensed User
Longtime User
Hi

can I get indication when I answered call, missed call, made a call, inside widget without creating timer to check my call log

I don't want to waste phone battery...
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can add an intent filter to the service receiver (manifest editor):
B4X:
AddRecieverText(ServiceName, <intent-filter>  
      <action android:name="android.intent.action.PHONE_STATE" />  
    </intent-filter>)
AddPermission("android.permission.READ_PHONE_STATE")
Then you will be able to track the state of the phone: TelephonyManager | Android Developers
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
Thanks
but since I am never used that method
how do I use for example in b4a the "call_state_ringing"
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
Thanks I found it, but I am still missing
how to do the same for outoing calls
(do something after I dialed / finished phone call)
 
Upvote 0
Top