Buenas, estoy iniciandome en programación en android y estoy guiándome por el libro Desarrollo de Aplicaciones para Android de Anaya. En el viene un ejemplo, lo he puesto tal y como está y me da error en la función de SetOnClickListener. No se que puede estar mal. Veis algo mal?
Código:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button = (Button)findViewById(R.id.hello);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//codigo a ejecutar cuando sea pulsado
EditText text = (EditText) findviewById(R.id.entry);
String enteredName = text.getText().toString();
String salutation = getResources() .getString(R.string.hello)
+""+ enteredName;
TextView out = (TextView) findViewById(R.id.out);
out.setText(salutation);
Saludos y gracias