, , , .
: findViewById(R.id.fragment2), .
;
@Override
public void onEventoSeleccionado(Evento e) {
boolean hayDetalle = (getFragmentManager().findFragmentById(R.id.FrgDetalleEvento) != null);
if(hayDetalle) {
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy hh:mm",Locale.ENGLISH);
Log.i("EOLog", "Hay Detalle");
((DetalleEventoFragment)getFragmentManager().findFragmentById(R.id.FrgDetalleEvento)).mostrarDetalle(Long.toString(e.getId()),formatter.format(e.getFecha()));
}
else {
Log.i("EOLog", "No hay detalle");
Intent i = new Intent(this,DetalleEventoActivity.class);
Bundle b = new Bundle();
b.putLong("IDEV", e.getId());
b.putLong("FECHA", e.getFecha());
i.putExtras(b);
startActivity(i);
}
}
:
@Override
public void onEventoSeleccionado(Evento e) {
int orientation = getResources().getConfiguration().orientation;
if(orientation == Configuration.ORIENTATION_LANDSCAPE) {
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy hh:mm",Locale.ENGLISH);
Log.i("EOLog", "Hay Detalle");
((DetalleEventoFragment)getFragmentManager().findFragmentById(R.id.FrgDetalleEvento)).mostrarDetalle(Long.toString(e.getId()),formatter.format(e.getFecha()));
}
else if(orientation == Configuration.ORIENTATION_PORTRAIT) {
Log.i("EOLog", "No hay detalle");
Intent i = new Intent(this,DetalleEventoActivity.class);
Bundle b = new Bundle();
b.putLong("IDEV", e.getId());
b.putLong("FECHA", e.getFecha());
i.putExtras(b);
startActivity(i);
}else
{
Log.i("EOLog", "Dispositivo erroneo");
}
}
,