I am making a basic chat application, and I want the my Phone Contacts List to show up in a ColinTreeListView.
I am using @DeveloperLeo Extension GetContactList to get the contacts list.
Here are the blocks I have tried:
There are two problems with this:
- When the screen initializes, I get a runtime error:
Attempt to invoke interface method 'android.app.Activity com.google.appinventor.components.runtime.ComponentContainer.$context()' on a null object reference
- When I tap on the floating icon, which is meant to return the phone contacts list in the ColinTreeListView “named as ContactsListView”, nothing shows up (it is blank).
Can someone please help me resolve this issue?
I think the request permission to read the contacts is wrong !!!
I can’t fond the right string
Made slight changes to the blocks, please have a look:
The developer himself said that this one permission is required to get contacts list:
Right, but android.permission.READ_CONTACTS ≠ READ_CONTACTS
that’s what I mean
Try change READ_CONTACTS with android.permission.READ_CONTACTS
But it is asking for permission to read contacts when I try it.
I start again because we both wrote at the same time
Try change READ_CONTACTS to “android.permission.READ_CONTACTS”
Still not showing, I think the problem is within the when
LeoContactList1 .GotContactsList block
Little trick he used to tell when something is wrong. Put a label in the design, next, inside LeoContactList1 set label text > numberList and check if you have results
Yes I am getting the number list,
That means there is something wrong with the later part…
This blocks is wrong for me… change to numberList !!!
OK go back… when you set label into LeoContactList1 have the error ?
global contacts instead of the arrangement in the Initialize Scroll? I don’t think that would work?
No call initialize scroll first , all blocks to top, call listview set to bottom
You need set the colin tree first before created a list