I try to pass an arraylist (which is not empty) from one fragment to another. This is the code in which I try to pass through the arguments:
Instalaciones_fragment itf = new Instalaciones_fragment();
Bundle bundle = new Bundle();
bundle.putParcelableArrayList("tipos_instalacion_array_list", arrayTiposInstalaciones);
itf.setArguments(bundle);
getFragmentManager().beginTransaction().replace(R.id.flContenedor, new Instalaciones_fragment()).addToBackStack(null).commit();
and this gift I try to recover it:
Bundle arguments = getArguments();
if (arguments != null){
arrayTiposInstalacion = arguments.getParcelableArrayList("tipos_instalacion_array_list");
}
The problem I have is that arguments
is null. Am I passing the arguments wrongly or recovering them wrong? Any solution?
Thanks in advance!