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 message:
.LOGTAG constants cannot be resolved.
Where is my mistake?
Edit Have . The problem was that when I hit Ctrl + Shft + O in Eclipse, he added this line:
import android.provider.SyncStateContract.Constants;
This prevented the compiler from working with its own Constants class.
source
share