Android Java project, minimal code to reproduce the problem:
Constants.java:
package alex.restaurantfinder;
public class Constants {
public static final String LOGTAG = "...";
}
ReviewCriteria.java:
package alex.restaurantfinder;
import android.app.Activity;
public class ReviewCriteria extends Activity {
static String s = Constants.LOGTAG; // error
}
Error message:
Constants.LOGTAG cannot be resolved.
Where is my error?
Edit.
The problem was, when I pressed Ctrl+Shft+O in Eclipse, it added this line:
import android.provider.SyncStateContract.Constants;
It prevented compiler to work with my own Constants class.
I think there might be another Class called
Constantsthat is imported automatically.can you try using the fully qualified name
alex.restaurantfinder.Constants.LOGTAG?