The code:
double indSRate[] = new double[c.getCount()];
indSRate[e++] = c.getDouble(c.getColumnIndex("s_rate"));
if (String.valueOf(indSRate[s]) == null) {
Log.d("Special Rate", String.valueOf(indSRate[s++]));
}
The field in the s_rate column was left blank by the user in an edit text field. Am I somehow turning it into a double?
Inside of a loop, I want to do certain things if the field was empty, and other things if it is not. But it seems to be either 0 or greater? I can’t test it being “0” or something different. I HAVE to test between isEmpty or not?
If the internal representation of a value is
NULLand your query requests aFLOAT, you get 0.0 as the return value (see this document).If you don’t want NULL values for that column in your Cursor, specify that in your query. If you don’t want NULL values in your database, specify that with a column constraint when you create the table.