for some reason ACTION_CALL is not working in my app. I have added the permission to the manifest:
<uses-permission android:name="android.permission.CALL_PHONE" />
Here is where I call action_call from my main activity:
case R.id.button2:
intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:(+44)12345678900"));
if(ActivityCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE)!= PackageManager.PERMISSION_GRANTED){
Toast.makeText(this, "No permission to call!", Toast.LENGTH_SHORT).show();
return;
}
startActivity(intent);
break;
Each time the toast shows and the number is not called. Any help would be appreciated! :)
manifest code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.adamw_000.lab_1_intents" >
<uses-permission android:name="android.permission.CALL_PHONE" />