Android Question [Solved] ContactUtils don't work in Android 8.1

asales

Expert
Licensed User
Longtime User
I use the example from Contact Utils Class with the runtime permissions and target SDK = 28.
https://www.b4x.com/android/forum/t...ad-write-access-to-the-stored-contacts.30824/

The code modified is in attached.

It works in Android 7.0 and 9.0, but don't in Android 8.1

I don't get any errors, even in unfiltered logs.
Only don't show the contacts.

B4X:
Light requested not available on this device. 2
Sensor:batt_therm:37100 mC
power_hint: no power profile selected yet
power_hint: no power profile selected yet
Light requested not available on this device. 2
START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10100000 cmp=b4a.example.ContactUtils/.main} from uid 2000
<qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
Loading /vendor/lib/hw/gralloc.msm8226.so from current namespace instead of sphal namespace.
[unnamed-1043-148] Failed to release buffer: Unknown error -1 (1)
Close system dialogs
<qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
Loading /vendor/lib/hw/gralloc.msm8226.so from current namespace instead of sphal namespace.
[unnamed-1043-149] Failed to release buffer: Unknown error -1 (1)
<qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
Loading /vendor/lib/hw/gralloc.msm8226.so from current namespace instead of sphal namespace.
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
Starter.rp.PERMISSION_READ_CONTACTS: true
Displayed b4a.example.ContactUtils/.main: +262ms
Explicit concurrent copying GC freed 14093(721KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 5MB/11MB, paused 89us total 149.552ms
Light requested not available on this device. 2
Could not find package: com.google.android.gms.stats.eastworld
Sensor:batt_therm:37100 mC

What may can be happening?

Thanks in advance for any help.
 

Attachments

  • contact_utils_rp28.zip
    12.2 KB · Views: 204

aaronk

Well-Known Member
Licensed User
Longtime User
Try:

B4X:
For Each c As cuContact In cu.FindAllContacts(False)                   
    lstContacts.AddSingleLine2(c.DisplayName, c)
Next
 
Upvote 0
Top