I don’t know why, but if I make a substring the app crashes!
Here’s the code:
while(data_mio.moveToNext())
{
titolo_da_inserire=data_mio.getString(prodotto);
titolo_da_inserire=titolo_da_inserire.substring(0,35)+"...";
personList.add( new Prodotto_per_lista(
R.drawable.freccia_1, titolo_da_inserire,
Integer.parseInt(data_mio.getString(id_immagine)))
);
}
Actually declare
String titolo_da_inserirelike,Now, before using
subString()check the length of String titolo_da_inserire