App Inventor 2 "Invalid Index 0, Size is 0" Error

386 views Asked by At

I am trying to create an Exercise Tracker app in App Inventor 2 for a school project, and everything seemed to be going great until I made it to the third screen.

I hit my start button and it said Invalid Index 0, Size is 0.

This is my code: MY CODE. enter image description here

Randy: Here is al link to an .aia file for my app. Using this, you should be able to view all my code. Let me know what you find!!!! It will be in the comments-sorry!!!

1

There are 1 answers

0
Json On BEST ANSWER

First of all,your open another screen's screen no was invalid. After i fixed it and tested it in the AppInventor's Emulator and it didn't show any error.

But I suspect that your problem was came from the data type of the global Time.The data type for the global Time is integer and the data that you store in the TinyDB is not only contents integer value (you can try to displays it in a label).So I would suggest you to store it in "Text/String" type rather than "Number/Integer".

Below is my way to store the Date and Time in the TinyDB after proper format it:

enter image description here