I am new to Android.
Please change the code accordingly.
Want to display the text messages dynamically, all of them are async calls, as i get response from the async call i need to display the text message on screen. They may not be in the same order as shown below.
Should not wait until all the Async call finishes and display all together using StringBuilder. This is not the solution i am looking for.
As and when i receive response i need to display the message line by line (with a small tick mark, if possible). Number of lines are not fixed, could be 20 or 50.
Thanks.
main.xml
<RelativeLayout
android:id="@+id/llMessages"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:visibility="visible">
<TextView
android:id="@+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="40dp"
android:layout_marginTop="65dp"
android:inputType="textMultiLine"
android:singleLine="false"
android:textIsSelectable="false"/>
</RelativeLayout>
MainActivity.java
TextView msgs = findViewById(R.id.message);
msgs.setText("First\n");
msgs.setText("Second\n"); //<-- Text comes 3 seconds later - Async calls
msgs.setText("Third\n"); //<-- Text comes 3 seconds later - Async calls
msgs.setText("Fourth\n"); //<-- Text comes 3 seconds later - Async calls
msgs.setText("Fifth\n"); //<-- Text comes 3 seconds later - Async calls