How to do some visible actions during telephone call?

Is it possible to do some visible actions during telephone call?

It could be something like:

  • play custom animation
  • inject some custom layout with controls

Answer

So you want to do something when Intent.ACTION_ANSWER is dispatched?

One idea – override the native Phone application (use appropriate Intent Filter, take a look here to see how Android resolves best matching Intent Filters), display your layout (including Answer/Reject buttons) and then use something like

Intent intent = getIntent(); 
startNextMatchingActivity(intent);

to start the Phone application.

I can see some problems with that solution – UI inconsistency and problems with programmaticaly answering the call (non-trivial, but not impossible), but it should be easy to try.

What are you trying to do?

If you want to mess with the layout when answering a call, your application has to be pretty close/duplicating the Phone app. It seems that’s not the case, otherwise you wouldn’t have asked the question.