0
public class FadingActionBarHelper extends FadingActionBarHelperBase {

private ActionBar mActionBar;
Activity a;

@SuppressLint("NewApi")
@Override
public void initActionBar(Activity activity) {
    mActionBar = activity.getActionBar();
    super.initActionBar(activity);
}

@SuppressLint("NewApi")
@Override
protected int getActionBarHeight() {
    return mActionBar.getHeight();
}

@Override
protected boolean isActionBarNull() {
    return mActionBar == null;
}

@SuppressLint("NewApi")
@Override
protected void setActionBarBackgroundDrawable(Drawable drawable) {
    mActionBar.setBackgroundDrawable(drawable);
}

}

I get the error "The method getActionBar () is undefined for the type Activity" when I try to access the actionbar of activity.

It is in the class FadingActionBarHelper FadingActionBar library. And I can not use it in my application.

1 Answers1

0

mActionBar = getActivity().getActionBar(); try this.

jofftiquez
  • 7,548
  • 10
  • 67
  • 121