I think the best way to do this is with a TextView using a scroller rather than with an EditText, because when a user who prints a message cannot edit it. Try something like this. This is a great way to print a message.
<ScrollView android:id="@+id/scroller" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFFFFF"> <TextView android:id="@+id/messageView" android:layout_height="fill_parent" android:layout_width="fill_parent" android:paddingBottom="8dip" android:background="#ffffff" android:textColor="#000000" /> </ScrollView>
And to automatically scroll down, call this method after clicking a message to view
private void scrollDown() { scroller.smoothScrollTo(0, messageView.getBottom()); }
Here scroller is ScrollView and messageView is TextView
You can also print a message with differnt color using HTML, for example
messageView.append(Html.fromHtml("<font color='green'><b>("+date+") "+ username +":</b></font><br/>"+ message+"<br/>", null, null));
source share