How to show the incoming call screen when the screen is locked?

后端 未结 1 967
春和景丽
春和景丽 2021-01-12 16:23

I\'m developing my custom calling app, like skype and I need to show \"incoming call\" screen to user, when I receive fcm message. I use full screen intent notification for

1条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-12 17:05

    Add following code in your CallActivity:

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON|WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    

    PS:It's java code,if you use kotlin then change it by yourself.

    0 讨论(0)
提交回复
热议问题