I am running my Android application in debug mode, where I have some constants defined as static final variables living in an Interface.
When I’m in debug mode in Eclipse, and I hover over these constants to see their contents, I see null for Strings and 0.0 for my doubles.
The Interface looks like this:
public interface IMyConstants {
public static double DOUBLE_CONST = 4.2235234;
public static String STRING_CONST= "Should be some string";
}
This interface is in an external non-Android project that is included in the classpath.
Other constants from other referenced Android projects seem to be giving me their info, and they are declared in exactly the same way.
I am wondering if the debugger is having a hard time reading these because the project is non-Android, as that’s the only difference I can initially see.
Right before my breakpoint, I did output the value of the constant DOUBLE_CONST to LogCat, and got the correct value.
This:
// Hovering over any of the constants here do not show their true value in debug
double value = myValue / IMyConstants.DOUBLE_CONST;
Log.i("MyProject", "IMyConstants.DOUBLE_CONST: " + IMyConstants.DOUBLE_CONST);
Log.i("MyProject", "IMyConstants.STRING_CONST: " + IMyConstants.STRING_CONST);
/*
* The breakpoint is here..
* hovering over DOUBLE_CONST above shows DOUBLE_CONST = 0.0
* hovering over STRING_CONST above shows STRING_CONST = null
*/
someBreakPointedMethod();
Gave:
12-19 23:32:54.316: INFO/MyProject(23806): IMyConstants.DOUBLE_CONST: 4.2235234
12-19 23:32:54.316: INFO/MyProject(23806): IMyConstants.STRING_CONST: Should be some string
Why doesn’t the debug object view (the one that pops up when you hover over a variable) work in this situation?
Just put your break point after Your statements
like this
The breakpoint Should be here..