Sorry, if this question seems too easy, but i'm new, and i'm still learning!
What i want to do, is to setText to a textview. I want to print the first 5 strings of an arraylist. Therefore i have done the following:
for (int i = 0; i < 5; i++) {
String date_time = allDate_time.get( i );
String date = date_time.substring( 0, date_time.indexOf( "T" ) );
String time = date_time.substring( date_time.indexOf( "T" ) + 1, date_time.indexOf( "+" ) );
textView2.setText( allId.get( i ) + " " + allTemp.get( i ) + " " + allHum.get( i ) + " " + allBat.get( i ) + " " + allMode.get( i ) + " " + date + " " + time + " " + allLux.get( i ) + "\n" );
}
Unfortunately, i suspect the setText to erase the past data, and only to print the last possibility. Is there anything i can do, so setText doesn't erase past data?
EDIT
textView2.append();
this worked for me. Thanks a lot for your answers!