I have a FragmentActivity
in the first tab of a TabHost
, and the FragmentActivity
itself holds a ViewPager
.
The
Your first approach should work fine... if you implement it correctly. I would expect your code to crash with a NullPointerException
.
Replace:
ImageView imageView = (ImageView)getView().findViewById(R.id.fragment_image);
with:
ImageView imageView = (ImageView)myFragmentView.findViewById(R.id.fragment_image);