The first method return a owner account with some fields but there isn't a email
The second method list the accounts owner returns only a emails value
How to merge?
I need to list the owner accounts recovering the email, name, surname and picture for each profile
The second method list the accounts owner returns only a emails value
B4X:
Sub GetOwnerAccount() As Cursor
Dim cr As ContentResolver
Dim u As Uri
u.Parse("content://com.android.contacts/profile")
cr.Initialize("cr")
Dim crsr As Cursor = cr.Query(u, Null, "", Null, "")
crsr.Position = 0
Return crsr
End Sub
Public Sub GetAccounts As List
Dim r As Reflector
Dim wAccounts As List
wAccounts.Initialize
r.Target = r.RunStaticMethod("android.accounts.AccountManager", "get", Array As Object(r.GetContext), Array As String("android.content.Context"))
Dim accounts() As Object
accounts = r.RunMethod2("getAccountsByType", "com.google", "java.lang.String")
For i = 0 To accounts.Length - 1
r.Target = accounts(i)
wAccounts.Add(r.GetField ("name"))
Next
Return wAccounts
End Sub
How to merge?
I need to list the owner accounts recovering the email, name, surname and picture for each profile