How to control the textview size through a seekbar where the textview is displayed in a viewpager?
<p>I want to control the size of the textview with the help of a seekbar i.e the textview size increases when the seekbar is dragged towards right and decreases while dragging towards left.I can do it when the textview is displayed in a simple activity UI.But here the problem is the textview have to be displayed inside a viewpager.Please help me.</p>

<p>Following is my code,</p>

<pre><code>public class MainActivity extends FragmentActivity {
    TextView tv;
    SeekBar seek;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        seek = (SeekBar) findViewById(R.id.seekBar1);
        /** Getting a reference to the ViewPager defined the layout file */
        ViewPager pager = (ViewPager) findViewById(R.id.pager);

        /** Getting fragment manager */
        FragmentManager fm = getSupportFragmentManager();

        /** Instantiating FragmentPagerAdapter */
        MyFragmentPagerAdapter pagerAdapter = new MyFragmentPagerAdapter(fm);

        /** Setting the pagerAdapter to the pager object */
        pager.setAdapter(pagerAdapter);

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    public class MyFragmentPagerAdapter extends FragmentPagerAdapter {

        final int PAGE_COUNT = 5;

        /** Constructor of the class */
        public MyFragmentPagerAdapter(FragmentManager fm) {
            super(fm);
        }

        /** This method will be invoked when a page is requested to create */
        @Override
        public Fragment getItem(int arg0) {

            MyFragment myFragment = new MyFragment();
            Bundle data = new Bundle();
            data.putInt("current_page", arg0 + 1);
            myFragment.setArguments(data);
            return myFragment;
        }

        /** Returns the number of pages */
        @Override
        public int getCount() {
            return PAGE_COUNT;
        }

        public CharSequence getPageTitle(int position) {
            return "Page #" + (position + 1);
        }

    }

    public class MyFragment extends Fragment {
        MainActivity m;
        int mCurrentPage;

        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);

            /** Getting the arguments to the Bundle object */
            Bundle data = getArguments();

            /** Getting integer data of the key current_page from the bundle */
            mCurrentPage = data.getInt("current_page", 0);

        }

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                Bundle savedInstanceState) {

            View v = inflater.inflate(R.layout.myfragment_layout, container,
                    false);
            tv = (TextView) v.findViewById(R.id.tv);

            tv.setText("You are viewing the page #" + mCurrentPage + "\n\n"
                    + "Swipe Horizontally left / right");
            return tv;

        }

    }

}
</code></pre>
