I have an activity from which I upload a fragment or another by clicking on a notification. The code is as follows:
public class Repeating_activity extends AppCompatActivity {
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle intent = getIntent().getExtras();
String tipoNotificacion = intent.getString("tipoNotificacion");
if(tipoNotificacion.equals("1")){
lanzarFragmentoMantenimientosVencidos();
} else if(tipoNotificacion.equals("2")){
lanzarFragmentoInspeccionesVencidas();
}
}
private void lanzarFragmentoMantenimientosVencidos(){
Mantenimientos_fragment mpf = new Mantenimientos_fragment();
Bundle bundle = new Bundle();
bundle.putInt("filtro", 2);
mpf.setArguments(bundle);
getFragmentManager().beginTransaction().replace(R.id.flContenedor, mpf).addToBackStack(null).commit();
}
private void lanzarFragmentoInspeccionesVencidas(){
Inspecciones_fragment ipf = new Inspecciones_fragment();
Bundle bundle = new Bundle();
bundle.putInt("filtro", 2);
ipf.setArguments(bundle);
getFragmentManager().beginTransaction().add(R.id.flContenedor, ipf).addToBackStack(null).commit();
}
}
Debugging, it does not reach any class of any fragment and I get the following errors:
05-28 11:44:43.706 3922-3922/com.kastel.COSMA E/FragmentManager: No view found for id 0x7f080082 (com.kastel.COSMA:id/flContenedor) for fragment Mantenimientos_fragment{5c9c505 #1 id=0x7f080082}
-
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.kastel.COSMA/com.kastel.COSMA.notificaciones.Repeating_activity}: java.lang.IllegalArgumentException: No view found for id 0x7f080082 (com.kastel.COSMA:id/flContenedor) for fragment Mantenimientos_fragment{5c9c505 #1 id=0x7f080082}