I am developing a library for Android and I keep getting a strange error about a static inner class when I use it in a sample project : "cannot find symbol variable":
This is my factored code :
Outer.java (SDK project)
public class Outer {
[...] // Attributes and methods
public static class Inner {
public static int x = 42;
}
}
MainActivity.java (Sample project)
import com.xxx.xxx.Outer;
public class MainActivity extends Activity {
[...] // Attributes
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.d("MainActivity", "x = " + Outer.Inner.x);
}
}
This is the log error :
.../sample/MainActivity.java:54: error: cannot find symbol Log.d("MainActivity", "x = " + Outer.Inner.x);
^
symbol: variable Inner
location: class Outer
I've another case into my SDK :
My class "ImageHelper" has a static inner class "Builder".
I use it into my SDK and it works, but when I want to use it in the sample project, I've the same error at build runtime.
Is there an error in my code ?