How To Show A Incoming Call Activity
I'm developing an Video and Voice chat app. What I need to do is to show some incoming call activity when an user try to call another user. I'm already using Firebase Cloud Message
Solution 1:
I was also developing this kind of app and what i did is : I used some Flags for WindowManager on that particular activity that i have to show on the screen at the time of incoming call event.
Try adding the below code in OnCreate() method of the activity that you are intend to showing on the screen.
getWindow().addFlags(
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
+ WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
| +WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
| +WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
And mention Following permissions in Manifest :
<uses-permissionandroid:name="android.permission.SYSTEM_ALERT_WINDOW"/><uses-permissionandroid:name="android.permission.WAKE_LOCK" />
Hope so,it helps you.!!
Post a Comment for "How To Show A Incoming Call Activity"