I have two packages. The class I want to import from the first package is declared as PUBLIC. Despite, when I test a file from the second package it shows me compilation err
Maybe you should try removing "new" keyword and see if works.
Because last time I got this error when I tried creating Typeface
something like this:
Typeface typeface = new Typeface().create("Arial",Typeface.BOLD);
closeDrawers(boolean)
is not public in android.support.v4.widget.DrawerLayout
. Cannot be accessed from outside package
@Override
public void onBackPressed() {
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
super.onBackPressed();
}
}
Do you by any chance have two PUBLICclass
classes in your project, where one is public (the one of which you posted the signature here), and another one which is package visible, and you import the wrong one in your code ?
Check the default superclass's constructor. It need be public or protected.
Note that the default when you make a class is not public as far as packages are considered. Make sure that you actually write public class [MyClass] {
when defining your class. I've made this mistake more times than I care to admit.
Let me guess
Your initial declaration of class PUBLICClass
was not public, then you made it `Public', can you try to clean and rebuild your project ?