the code working fine on my android 10 device, but on my android 11 device it didn’t work. i don’t know why, i assume it’s because android 11.
this is my code… please help
Your code is perfect. But in Android 11 Android restricted to show the full list of installed apps that’s why it isPackageInstalled block always return false
You won’t need to check wether the APK is installed or not. If your activity started by the activity starter then it means your app is installed and if it shows the error then it mean app is not installed in user device.
I just started the activity of my one app from another app and if the app is not installed then It triggers the Error Occurred event of the screen where you can redirect the users to the play store for downloading the app.
According to Android documentation, we need to add the packages(that we want to work with) in queries element in our APK manifest to work with specific package in above android 10 devices.
Hello, update here.
I finally got it working now. When screen 1 error occured, open screen 2
And when screen 2 initialize, do start activity. It works.
Thanks for the help