I tried searching all SO questions but seems its because missing setContentView or need clean the project, my issue its i got java.lang.IllegalArgumentException: No view found for id but its "random" i can't figure out why some devices throw this exception i have Activity->FragmentA->Nested fragment and works great but sometimes after a lot of time when i try to open my app crash this its the code in OncreateView
if(savedInstanceState==null)
{
try {
FragmentDestination f = FragmentDestination.newInstance(null,null);
f.setOnDestinationSelectedListener(this);
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.destinationHolder,f).commit();
}catch (IllegalArgumentException ex){ex.printStackTrace();}
}
This seems to work well but some time the exception its raised (destinationHolder its a frameLayout container)
and sometimes if i use Activity->FragmentA->Nested FragmentA-> replaceFragmentA using the next code sometimes raise the exception.
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.nested_fragment_a,f).commit();
Any advice? Thanks