If My App Is Selected As The Default Dialer App. Is It Possible To Make Intent To Show Call In The Dialer
I have implemented a CallService which I have in the manifest like this:
The WindowManager.LayoutParams to use:
WindowManager.LayoutParams(
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT,
VERSION.SDK_INT >= VERSION_CODES.O ? LayoutParams.TYPE_APPLICATION_OVERLAY : LayoutParams.TYPE_SYSTEM_ERROR,
LayoutParams.FLAG_NOT_FOCUSABLE | LayoutParams.FLAG_SHOW_WHEN_LOCKED | LayoutParams.FLAG_DISMISS_KEYGUARD);
EDIT:
The code you posted is trying to make an Activity show up on top of the incoming call screen, instead you should create a View and add it to the windowManager as an alert view. i.e. instead of:
setContentView(R.layout.activity_call)
val wm = getSystemService(Context.WINDOW_SERVICE) as WindowManager
wm.addView(window.decorView, params)
Try doing something like this (not tested code):
View view = LayoutInflater.from(this).inflate(R.layout.activity_call)
val wm = getSystemService(Context.WINDOW_SERVICE) as WindowManager
wm.addView(view, params)
Post a Comment for "If My App Is Selected As The Default Dialer App. Is It Possible To Make Intent To Show Call In The Dialer"