I already read this article and several others, but I'm still not sure how to make a phone call with a speaker. Someone suggested that
Before you start a call, you register the listener and then activate the speakers. After receiving CALL_STATE_IDLE, you will remove the listener and turn off the speakers again.
But what does this mean?
Here is my code -
Intent intentCallActivity = new Intent(context, tabWidgetActivity.class);
intentCallActivity.putExtra("number", phoneNumber);
intentCallActivity.putExtra("speaker", true);
intentCallActivity.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intentCallActivity);
This does not work correctly. Sometimes, when I test this code, my phone speaker does not work correctly. Perhaps this is due to the fact that I do not deactivate the speakerphone. What else do I need to do?
source
share