Vale, ya he optimizado el codigo, ha funcionado y ha quedado así:
package com.mycompany.myapp;
import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;
public class MainActivity extends Activity
{
/** Called when the activity is first created. *
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
TextView HW = new TextView (this) ;
HW.setText("HELLOWORLD \n");
int i;
for(i = 0; i < 11; i++)
{
setContentView(HW);
HW.setText(HW.getText() + "HELLOWORLD \n");
}
}
}
A ver si entiendo lo que he hecho . El programa imprime un hello world, y luego asigna al HW lo anteriormente escrito y lo vuelve a escribir, no???
|