I have made an incoming call reciever. Everything is working properly but the problem is that truecaller is opening upon my reciever due to which the UI of my receiver is somewhat hidden.
Any suggestions on how to suppress or kill TrueCaller?
You need inflate a overlay with WindowManager.
private void putOverlay(View view) {
try {
// Create Overlay
LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
overlay = inflater.inflate(R.layout.overlay, null);
final LayoutParams params = new LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT,
LayoutParams.TYPE_PHONE,
LayoutParams.FLAG_NOT_FOCUSABLE,
PixelFormat.TRANSLUCENT);
WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);
wm.addView(view, params);
} catch (Exception ex) {
logManager.error("SICS - Exception: " + ex.toString());
}
}
Something like this. Hope it helps you.