0

I have made an application that makes the calls to a telephone number, but I also want it to have the "end call" button in this application. In case it can't, then it can have the option to force the application to stop calls

btn_llamadas.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
        Intent i = new Intent(Intent.ACTION_CALL, Uri.parse("tel:945192696")); //

        if (ActivityCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
            return;
        }
        startActivity(i);
    }
});
André Schäfer
  • 608
  • 5
  • 15

1 Answers1

0

You would have to use a PhoneStateListener to check if the call is ended or now.

Check this link for instructions.

woooh77
  • 141
  • 1
  • 4