Hello, I was wondering if there is a way to redefine the incoming call screen to add additional features to it? If you could point me in the right direction or provide sample code?
----------------------------------------------- --- EDIT: --------------------------
I got a receiver that works well when a call arrives, but how can I get the current window to override the call screen? This is what I got so far ... but I get a classCastException trying to apply to the action from the context, I cannot think of another way to access the window.
@Override public void onReceive(Context context, Intent intent) { Bundle extras = intent.getExtras(); if (extras != null) { String state = extras.getString(TelephonyManager.EXTRA_STATE); Log.w("DEBUG", state); Log.w("DEBUG", "-------------------------------------------------- Broadcast Received"); if (state.equals(TelephonyManager.EXTRA_STATE_RINGING)) { String phoneNumber = extras .getString(TelephonyManager.EXTRA_INCOMING_NUMBER); Log.w("DEBUG", phoneNumber); Activity activity = (Activity)context.getApplicationContext(); Window window = activity.getParent().getWindow(); window.addContentView(window.findViewById(R.layout.textalertbuttonview),null); Log.w("DEBUG", "------------------------Button Added"); } } else { Log.w("DEBUG", "---------------------------------------------------no Extras"); } }
----------------------------------------------- --- EDIT 2: --------------------------
After some research, it doesn't seem like I can really add items to the screen of the actual incoming call. So I have to make my own look and redefine the incoming call screen. But I'm still open to ideas ... I saw an incoming call plus, but I can not find the source code for this project.
source share