0

I am developing a call recorder application, which is working fine. I want to give the user an option to decide whether to record a call or not. I want to add a button on top of the ongoing call screen, but I am not sure if that is possible. There are some threads which give hint or code to add on top of incoming or outing screen, but I want to add it on top of the ongoing screen.Any help would be appreciated.

//Custom dialog showing after the call has been disconnected, I want to show as soon as the call has been started.

if (extraState.equals(TelephonyManager.EXTRA_STATE_OFFHOOK)) {
                        Intent intentDialog = new Intent(context, CustomDialog.class);
                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);

                        context.startActivity(intentDialog);

                        Intent myIntent = new Intent(context,
                                RecordService.class);
                        myIntent.putExtra("commandType",
                                Constants.STATE_CALL_START);
                        context.startService(myIntent);
                    }
Paras Watts
  • 2,565
  • 4
  • 21
  • 46
  • yes you can, design like a truecaller app – Ganesh Gudghe Sep 04 '17 at 04:36
  • you have to write broadcast receiver for this. [refer this links](https://stackoverflow.com/questions/16098545/how-to-modify-incoming-and-outgoing-call-screen-view-in-android) and [this link](https://stackoverflow.com/questions/15683952/pop-up-window-over-android-native-incoming-call-screen-like-true-caller-android/16080204#16080204) , these links may help you – Arpit Prajapati Sep 04 '17 at 04:38
  • I am already using the broadcast receiver to detect calls. – Paras Watts Sep 04 '17 at 04:40
  • I am confused about how to add button on top of that – Paras Watts Sep 04 '17 at 04:40
  • Does making a pop up window on receiving broadcast help you? Like mentioned in this: https://stackoverflow.com/questions/16098545/how-to-modify-incoming-and-outgoing-call-screen-view-in-android – 10101010 Sep 04 '17 at 05:25
  • I am trying to add a custom dialog, will get back to you once done – Paras Watts Sep 04 '17 at 05:27
  • I have added a custom dialog on top of call screen, but it is showing after the call is ended and too after a delay of few seconds, I have not added any delay, I have called the intent in EXTRA_STATE_OFFHOOK condition, but it is showing only after the call has been disconnected. I am updating my code – Paras Watts Sep 04 '17 at 06:36

0 Answers0