ViewPager unable to load images lazily with Picasso

前端 未结 2 1195
没有蜡笔的小新
没有蜡笔的小新 2021-01-17 04:34

I have a FragmentActivity in the first tab of a TabHost, and the FragmentActivity itself holds a ViewPager.

The

2条回答
  •  礼貌的吻别
    2021-01-17 05:11

    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);
    

提交回复
热议问题