I have a programmatically generated ScrollView with a TextView inside of it. I wish to update the text in the TextView from time to time and some have implemented a handler function to update the TextView GUI element. This seems to call/work correctly.
However, currently the only way I have found to actually get the TextView to show the appended information is to call:
consoleText.append("New text to add to TextView");
// then:
myScrollView.removeView(myTextView);
myScrollView.addView(myTextView);
This is not particularity optimal and was wondering how else I can refresh the contents of the ScrollView to show my newly added information…
Also:
invalidate();
postvalidate();
Do not seem to do anything – the TextView object has the new text in it (looking in debug) it’s just not drawing it to the screen unless I call the add/remove function.
Thanks for any information/help you can give
FR
You should call
invalidate()andrequestLayout()on the TextView, and perhaps the ScrollView.