As you will see, I am a novice programmer. I have, what I think is a basic InputList. Everything works fine. Tap the LangButton and see the list, choose item from list, move on. However, if the user hits the OS "Back" button while the list is up, I get a crash.
LastException java.lang.ArrayIndexOutOfBoundsException:length=12; index=-3
How do I avoid this? Example code would be much appreciated.
NOTE: I am running a fairly old version of B4A v2.22
Sub LangButton_Click
Dim Languages As List
Languages.Initialize
Languages.Add("English")
Languages.Add("Bemba")
Languages.Add("Lozi")
Languages.Add("Luvale")
Languages.Add("Lunda")
Languages.Add("Tonga")
Languages.Add("Kaonde")
Languages.Add("Nyanja (Lusaka)")
Languages.Add("Nyanja (Standard)")
LangChoice = Languages.Get(InputList(Languages, "Language Choice",0))
LabelLang.Text = LangChoice
End Sub