I am attempting to make a custom implementation of Android's StackView by extending AdapterViewAnimator myself. There are several methods contained in AdapterViewAnimator which would prove useful to my subclass, and so I put my subclass in the same package android.widget
hoping to gain access to them since they are package-level methods:
void configureViewAnimator(int numVisibleViews, int activeOffset) {
if (activeOffset > numVisibleViews - 1) {
// Throw an exception here.
}
mMaxNumActiveViews = numVisibleViews;
mActiveOffset = activeOffset;
mPreviousViews.clear();
mViewsMap.clear();
removeAllViewsInLayout();
mCurrentWindowStart = 0;
mCurrentWindowEnd = -1;
}
Note that this method is a package level method, which is why my subclass needs to be in android.widget
as well. Even so, the compiler (Java 7) tells me that the method does not exist, and so I cannot call the method on my superclass in my class:
package android.widget;
public class Foo extends AdapterViewAnimator {
public void init(){
super.configureViewAnimator(3,1); // Method does not exist.
}
}
Am I missing something here? Why can't my subclass call the superclass package-level method?