The answer Kar0t is perfectly fine but this may help somebody. On my case I had a fragment inside of a fragment and I was getting the wrong FragmentManager. I just had to call:
getChildFragmentManager()
and then just find the Fragment as usual:
fm.findFragmentById(R.id.fragment)