What is the intended use of the new createelement capability of listview? The method signature, CreateElement( mainText , detailText , imageName ), seems to be intended to return something (a dictionary) that might be useful for building a listview with images. However, the listview listdata attribute is not available to use in code.
What is an example of something CreateElement could be used for?
If so, I cannot tell how to use it. I took a wild guess and stuck the dictionaries in a list and set listview elements to the list of dictionaries, hoping that some parameter magic would interpret the dictionaries in the list as source for text and detail and image. No such luck. Maybe this is just a placeholder method for later.
If you right click and Do It on a .CreateElement block when running companion, you will see how it constructs a dictionary. You can, as I have shown, just add this as a list item to a list.
Worked perfectly as advertised. I think since I was pulling the image from storage that I needed a full path definition (including the file: protocol).
The image files are taken from the /Pictures/ directory in the Apps file scope. The file name must be fully expanded for the image reference to work.
Note that if you want to delete the file, then you want to reference /Pictures/[filename]. So for example, image picture file name for the ListView CreateElement is file:///storage/emulated/0/Android/data/appinventor.ai_freddiegarvin.GeologyFieldTrip/files/Pictures/app_inventor_1630924067627.jpg
A call to file.delete needs /Pictures/app_inventor_1630924067627.jpg