import android.widget.*; import android.view.*; import android.content.Context; import android.app.Activity; import java.util.Timer; import java.util.TimerTask; public class main { static String text = ""; public static View main(final Activity context) { ScrollView sv = new ScrollView(context); final TextView tv = new TextView(context); tv.setText(""); sv.addView(tv); Timer myTimer = new Timer(); myTimer.schedule(new TimerTask() { public void run() { context.runOnUiThread(new Runnable() { public void run() { text += "This is more text.\n"; tv.setText(text); } }); } }, 0, 1000); return sv; } }