Android programming; getting a small error
<p>I'm working on an Android Application and I'm using the .setAdapter command and I'm getting the red squiggle under it. Eclipse tells me this. "The method setAdapter(PagerAdapter) in the type ViewPager is not applicable for the arguments (Upperbody.MyPagerAdapter)" </p>

<p>Specifically right here;</p>

<pre><code>myPager.setAdapter(adapter); 
</code></pre>

<p>Here's my code;</p>

<pre><code>package com.example.gymbuddy; 

import android.app.Activity; 
import android.content.Context; 
import android.os.Bundle; 
import android.os.Parcelable; 
import android.support.v4.view.ViewPager; 
import android.view.LayoutInflater; 
import android.view.View; 

public class Upperbody extends Activity { 

   @Override 
   public void onCreate(Bundle savedInstanceState) { 
   super.onCreate(savedInstanceState); 
   setContentView(R.layout.activity_upperbody); 

   MyPagerAdapter adapter = new MyPagerAdapter(); 
   ViewPager myPager = (ViewPager) findViewById(R.id.myfivepanelpager); 
   myPager.setAdapter(adapter); 
   myPager.setCurrentItem(2); } 

   public class MyPagerAdapter extends Activity { 

    public int getCount() { 
        return 9; 
    } 

    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.upper0; 
            break; 
        case 1: 
            resId = R.layout.upper1; 
            break; 
        case 2: 
            resId = R.layout.upper2; 
            break; 
        case 3: 
            resId = R.layout.upper3; 
            break; 
        case 4: 
            resId = R.layout.upper4; 
            break; 
        case 5: 
           resId = R.layout.upper5; 
           break; 
        case 6: 
           resId = R.layout.upper6; 
           break; 
        case 7: 
           resId = R.layout.upper7; 
           break; 
        case 8: 
           resId = R.layout.upper8; 
           break; } 

        View view = inflater.inflate(resId, null); 

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

        return view; } 

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

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

    public Parcelable saveState() { 
        return null; } 

   } 

} 
</code></pre>
