I used following code for phone call.But the call is not working .can anyone help me? I also given manifest Call Phone permission.
call = (TextView) findViewById(R.id.GuestPhoneNo1);
call.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String no = call.getText().toString();
// Toast.makeText(Accepted_Details.this, no, Toast.LENGTH_SHORT).show();
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + no));
/*if (ActivityCompat.checkSelfPermission(Accepted_Details.this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}*/
startActivity(callIntent);
}