Android Question PackageManager don't find Whatsapp

andredamen

Member
Licensed User
I have a strange thing while using the following:

B4X:
    Dim Intent2 As Intent
    Dim pm As PackageManager
    Intent2 = pm.GetApplicationIntent("com.whatsapp")
    If Intent2.IsInitialized Then
        ToastMessageShow("WhatsApp Installed",True)
    Else
        ToastMessageShow("WhatsApp NOT Installed",True)
    End If
When I make a timy app with only this code the PackageManager detect Whatsapp on my phone. This is good.

When I us the same code in one of my bigger apps the PackageManager DON'T detect Whatsapp on my (the same) phone.

What is happening here? Does someone has the answer?
 

JohnC

Expert
Licensed User
Is there any difference in the manifest between the two apps?
 

andredamen

Member
Licensed User
I still have to answer the question from John: the only difference in the two apps is that the app where the Intent DON'T work is that in the Manifest of that app I have added the permisson PERMISSION_CALL_PHONE.
 

andredamen

Member
Licensed User
The phone has indeed Android 11. On a older phone, wirh Android 6, then Intent did find Whatsapp in the good way.

Thanks, thanks, thanks!
 
Top