Android Question Get Accounts

fishwolf

Well-Known Member
Licensed User
Longtime User
I have notice that some old devices work fine this code
B4X:
R.Target = R.RunStaticMethod("android.accounts.AccountManager", "get", _
        Array As Object(R.GetContext), Array As String("android.content.Context"))
    
    Accounts = R.RunMethod2("getAccountsByType","com.google", "java.lang.String")
and on recent devices this code:
B4X:
jo.InitializeStatic("android.accounts.AccountManager")
           GetAccounts_StartActivityForResult(jo.RunMethod("newChooseAccountIntent", Array(Null, Null, Array As String("com.google"), Null, Null, Null, Null)))

how can I choose which code to execute?

Thanks
 
Top