Good! Depending on a given data I would like to load one layout or another in the setContentView. I have put the following:
//obtengo el dato enviado desde la otra activity
dato = getIntent().getExtras().getInt("id");
Log.i("seguimiento", "antes del if " + getIntent().getExtras().getInt("id"));
Log.i("seguimiento", "antes del if " + dato);
if (dato == 7) {
Log.i("seguimiento", "dentro del if " + dato);
setContentView(R.layout.ficha_diferente);
} else if (dato == 1 || dato == 2 || dato == 3 || dato == 4 || dato == 5 || dato == 6 || dato == 8){
Log.i("seguimiento", "dentro del else if " + dato);
setContentView(R.layout.ficha);
} else if (dato == 9 || dato == 10 || dato == 11 || dato == 12 ){
Log.i("seguimiento", "dentro del segundo else if " + dato);
setContentView(R.layout.ficha_tarde);
}
It enters correctly all the ifs since it crawls with the Logs, but only when data == 1 || data == 2 || data == 3 || data == 4 || data == 5 || data == 6 || data == 8, that is, when it enters the first else if, is when I load the layout in the rest I close the activity and I return to the previous one.