0

I am trying to simulate the slide menu in android as demonstrated here: How did Google manage to do this? Slide ActionBar in Android application .

However, Eclipse does not seem to recognize PagerTabStrip even though I have included android-support-v13.jar in my build. I have tried importing android.support.v4.view.PagerTabStrip but to no avail.

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.support.v4.view.PagerTabStrip;

public class ExtendedPagerTabStrip extends PagerTabStrip {

private boolean enabled;

public ExtendedPagerTabStrip(Context context, AttributeSet attrs) {
    super(context, attrs);
    this.enabled = true;
}

@Override
public boolean onTouchEvent(MotionEvent event) {
    if (this.enabled) {
        return super.onTouchEvent(event);
    }

    return false;
}

@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
    if (this.enabled) {
        return super.onInterceptTouchEvent(event);
    }

    return false;
}

public void setNavEnabled(boolean enabled) {
    this.enabled = enabled;
}
}

I get the following error: The import android.support.v4.view.PagerTabStrip cannot be resolved.

I seem to have successfully built the support library because the ViewPager class works well. What am I doing wrong? Why does PagerTabStrip cannot be recognized?

Community
  • 1
  • 1

2 Answers2

10

Right Click on you project..

click on "Android Tools" -> "Add Support Library"

after that it will download the android-support.jar. and add it to your project.

after that your eclipse will recognize PagerTabStrip

0

You should use android-support-v4.jar instead.

UgglyNoodle
  • 3,017
  • 1
  • 21
  • 17
  • I have also tried including android-support-v4.jar in my build path, but PagerTabStrip still cannot be resolved. – user1699366 Oct 06 '12 at 04:29