Displaying imageIcon and textview contained in GridView in a ViewPager
<p>I am having trouble getting the below code to work. what am planning to do is this: I have two Views and two adapters, each view has a GridView (contained in a separate Layout)which I used to add the ImageIcon and TextView (both also in another Layout). Now I want to add this two views in a ViewPager(also in a separate Layout) but the problem is that only the GridView displays without the imageicon or textview.
Here is the code</p>

<p>GridView for first View</p>

<pre><code>GridViewProduct=(GridView)findViewById(R.id.gvmainproduct);
     Resources res_prod=getResources();
     final List&lt;Apps_Info&gt;ListApps_Info_Product=new ArrayList&lt;Apps_Info&gt;();

     ListApps_Info_Product.add(new Apps_Info(BitmapFactory.decodeResource(res_prod, R.drawable.adobreader),"Adobe Reader",""));
     ListApps_Info_Product.add(new Apps_Info(BitmapFactory.decodeResource(res_prod, R.drawable.dictionary),"Dictionary",""));
GridViewProduct.setAdapter(new Apps_Info_Adapter_Product(this,ListApps_Info_Product));
</code></pre>

<p>GridView for Second View</p>

<pre><code>mGridView=(GridView)findViewById(R.id.gvmain);

    Resources res=getResources();

   final List&lt;Apps_Info&gt;ListApps_Info=new ArrayList&lt;Apps_Info&gt;();

   ListApps_Info.add(new Apps_Info(BitmapFactory.decodeResource(res, R.drawable.youtube1),"YouTube","com.google.android.youtube"));
   ListApps_Info.add(new Apps_Info(BitmapFactory.decodeResource(res, R.drawable.veetle1),"Veetle","com.veetle.android.lite"));
   mGridView.setAdapter(new Apps_Info_Adapter(this,ListApps_Info));
</code></pre>

<p>ViewPager Code</p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.viewflipper);
    cxt = this;

    awesomeAdapter = new AwesomePagerAdapter();
    awesomePager = (ViewPager) findViewById(R.id.awesomepager);
    awesomePager.setAdapter(awesomeAdapter);
    awesomePager.setCurrentItem(0);
}
   private class AwesomePagerAdapter extends PagerAdapter{


    @Override
    public int getCount() {
        return NUM_AWESOME_VIEWS;
    }
    @Override
    public Object instantiateItem(View collection, int position) {

        LayoutInflater layoutinflate=(LayoutInflater)FavouriteApps.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        int resId=0;
        switch(position){
        case 0:
            resId=R.layout.main;


            break;
        case 1:
        resId=R.layout.mainviewproduct;

        break;
        }
        View views=layoutinflate.inflate(resId, null);


        ((ViewPager) collection).addView(views,0);

        return views;
    }
    @Override
    public void destroyItem(View collection, int position, Object view) {
        ((ViewPager) collection).removeView((View) view);
    }



    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view==((View)object);
    }
    @Override
    public void finishUpdate(View arg0) {}


    @Override
    public void restoreState(Parcelable arg0, ClassLoader arg1) {}

    @Override
    public Parcelable saveState() {
        return null;
    }

    @Override
    public void startUpdate(View arg0) {}

}
</code></pre>
