Home > database >  Calling Intent not working above android version 11 in Java
Calling Intent not working above android version 11 in Java

Time:11-12

I am facing an issue in that I cannot send calling Intent above android version 11 below android version 11 Calling Intent working correctly.

Intent intent = new Intent(Intent.ACTION_DIAL);
//Demo number
intent.setData(Uri.parse("tel:"  "0000000000");
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}

CodePudding user response:

add below for dial call action,

<manifest>
    <queries>
        <!-- Specific intents you query for -->
        <intent>
            <action android:name="android.intent.action.DIAL" />
        </intent>
    </queries>
</manifest>

CodePudding user response:

In order to work in Android 11 and above, you have to specify the DIAL intent in AndroidManifest.xml. It should be outside application tag and inside manifest tag.

 <queries>
    <intent>
        <action android:name="android.intent.action.DIAL" />
    </intent>
 </queries>

for example :

enter image description here

  • Related