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);
}
});