Why fragment not working
<p>I want to change text in a textview in fragment , I can do this easily in instantiateItem , but after instantiateItem , textView is null and I can not call with </p>

<p>MyPagerAdapter.textView.SetText();</p>

<pre><code>private class MyPagerAdapter extends PagerAdapter {


        TextView textView;

        public int getCount() {
            return 5;
        }

        public Object instantiateItem(View collection, int position) {

            LayoutInflater inflater = (LayoutInflater) collection.getContext()
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

            int resId = 0;
            switch (position) {
            case 0:
                resId = R.layout.farleft;
                 View view = inflater.inflate(resId, null);
                ((ViewPager) collection).addView(view, 0);
                 textView = (TextView)view.findviewById(R.id.textvvvv);
                 return view;

            case 1:
                resId = R.layout.left;
                break;
            case 2:
                resId = R.layout.middle;
                break;
            case 3:
                resId = R.layout.right;
                break;
            case 4:
                resId = R.layout.farright;
                break;
            }


        }

        @Override
        public void destroyItem(View arg0, int arg1, Object arg2) {
            ((ViewPager) arg0).removeView((View) arg2);

        }

        @Override
        public boolean isViewFromObject(View arg0, Object arg1) {
            return arg0 == ((View) arg1);

        }

        @Override
        public Parcelable saveState() {
            return null;
        }
}
</code></pre>

<p>But , the starnge is here when I change text in instantiateItem with </p>

<pre><code>textView.SetText("EEE");
</code></pre>

<p>it works well , but I can not change text outside MyPageAdapter, why ?</p>
