I want to show an internal log inside an activity. This log consists of text strings that inform the user about the status of an operation.
For example:
Process started
Doing task A
Doing task B
…
Process stopped
The only way that comes to my mind is to use a ScrollView with a TextView that will be updated whenever there is a new string in the log, but this solution seems inelegant.
Is there any UI widget that serves as a container for lines of text?
EDIT: I prefer not to use a ListView, I just want to show lines of plain text in a container, something simpler
EDIT 2: I used to develop Win32 programs in Delphi. There we have a TMemo component that serves as a container for lines of text. I’m looking for something similar in Android
What’s inelegant about updating a TextView? This is the most straightforward and simplest way to implement what you’re looking for.
A TextView updated by a background polling event, probably by way of an Thread/AsyncTask is what I would try first. Don’t confuse necessary complexity with inelegance. Sometimes the obvious first idea you have is the correct one.