Created an item in the Listbox. I assigned him an onClick handler. in the handler made the creation of a .txt file with the name of the same element.
void __fastcall TForm1::ListBoxItem2Click(TObject *Sender) { ListBox1->Items->SaveToFile("(ListBox1->Items->Strings[ListBox1->ItemIndex])+".txt"); } When compiling for win32 everything works fine. BUT when compiling under android, when you first click on an element (item), this error crashes (photo): 
But, if I click the next time (and any of the elements of this listbox), all handlers work fine (including this one). Why is that? How to fix it?