1

I searched for many question but didn't found any satisfying answer.What I want is to show a customized screen when we received call & when we call to someone it should show a customized screen instead of default screen like in true-caller app.I would appreciate if any one can provide a example for the same.

Thanks in advance.

Neerav Shah
  • 713
  • 5
  • 18
  • 39

1 Answers1

3

For outgoing calls: I did the following as a work around and it is working fine. I created an outgoing receiver with all permissions required in manifest..

Called the Activity after a delay by using a handler.

Like this:

@Override
public void onReceive(Context context, Intent intent) 
{
    c = context;
    setResultData(null);
    phonenumber = getResultData();
    if (phonenumber == null)
    {
        phonenumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
    }
    setResultData(phonenumber);
    callActionHandler.postDelayed(runRingingActivity, 1000);
}


Handler callActionHandler = new Handler();
Runnable runRingingActivity = new Runnable() 
{
    @Override
    public void run() 
    {

        Intent intentPhoneCall = new Intent(c, OutgoingCallActivity.class);
        intentPhoneCall.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        intentPhoneCall.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        c.startActivity(intentPhoneCall);
    }
};

You can use the phone number to send it to the new activity.

src

Community
  • 1
  • 1
Mohamed ALOUANE
  • 5,349
  • 6
  • 29
  • 60
  • hi thanks for example but what I want is like truecaller when we have an incoming call it shows a blank space if there's no image of the person i want to customizes that unused part through an app which will show some message in list view form. – Neerav Shah Oct 31 '14 at 04:26
  • and what have to written in OutgointCallActivity.class – Neerav Shah Oct 31 '14 at 05:43