Can I answer a call programmatically in Android?
I found in some places that this is not possible, but then installed the application https://play.google.com/store/apps/details?id=com.a0softus.autoanswer works fine.
I searched and tried a lot of things a lot, in addition, the rejection of the call works fine, but the answer to the call does not work.
I tried the following code to answer calls, as shown below:
import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.res.AssetFileDescriptor; import android.media.AudioManager; import android.media.MediaPlayer; import android.telephony.TelephonyManager; import android.util.Log; import android.view.KeyEvent; import java.io.IOException; import java.lang.reflect.Method; import app.com.bikemode.MainActivity; import app.com.bikemode.R; public class IncomingCallReceiver extends BroadcastReceiver { String incomingNumber = ""; AudioManager audioManager; TelephonyManager telephonyManager; Context context; private MediaPlayer mediaPlayer; public void onReceive(Context context, Intent intent) {
The call reject function works fine, but the call reception does not work.
java android telephonymanager phone-call
Rahul Vats Apr 12 '16 at 7:01 2016-04-12 07:01
source share