The following code has pulled up the Facebook app if it exists on the device and has worked for years. It now crashes my app if my app is running on Android 10. What do I need to change to make it work for Android 10 as well?
If the Facebook app is running in the background then the code works fine, but if it's not running in the background then my app crashes when trying to pull up the Facebook app on Android 10.
B4X:
Dim pm As PackageManager
Dim In As Intent
In = pm.GetApplicationIntent("com.facebook.katana")
If In.IsInitialized Then 'This part crashes my app
In.Initialize(In.ACTION_VIEW,"fb://page/280396775373599")
StartActivity(In)
Else
Dim Facebook As Intent
Facebook.Initialize(Facebook.ACTION_VIEW, "http://www.facebook.com/LDSScripturesPremium")
StartActivity(Facebook)
End If
If the Facebook app is running in the background then the code works fine, but if it's not running in the background then my app crashes when trying to pull up the Facebook app on Android 10.
Last edited: