Tema: [ CONSULTA ] Error al ejecutar app en AVD
Ver Mensaje Individual
  #3  
Viejo 16/04/14, 21:07:24
Avatar de joaco_bozzalla
joaco_bozzalla joaco_bozzalla no está en línea
Usuario novato en la web
Mensajes: 6
 
Fecha de registro: abr 2014
Mensajes: 6
Tu operador: Movistar
Mencionado: 0 comentarios
Tagged: 0 hilos
Creo que la linea 17 es la creacion del TextView:

public class MainActivity extends ActionBarActivity {
TextView texto = (TextView)findViewById(R.id.texto);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment())
.commit();
}

Button boton = (Button) findViewById(R.id.boton);
boton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
texto.setText("El boton anda.");
}
});
}
Responder Con Cita