我正在开发一个呼叫记录器应用程序,它运行正常。我想给用户一个选项来决定是否录制一个电话。我想在正在进行的通话屏幕上添加一个按钮,但我不确定是否可以。有一些线程提供提示或代码添加到传入或外出屏幕之上,但我想在正在进行的屏幕上添加它。任何帮助将不胜感激。
//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);
}