Running Off the End of the List

Lists can expand as you add more items to them, but at any time, they are finite. It is possible to ask for an item number that is beyond the end of the list (usually using the select list item block), and this generates an error that is visible to the user on the phone, such as the one in Figure 6.35. If you are connected in Live Mode, you will also see the error in App Inventor in the browser (see Figure 6.36).

Image

Figure 6.35 A list error, as seen on the device.

Image

Figure 6.36 A list error, as seen in App Inventor ...

Get Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.