Sembra che quando si tratta di * value.getFloat ("Value_Quotient", quotient_Float) == null *, incontra un problema. Come posso risolvere questo?In Java, come si controlla se una variabile mobile è nullo?
private void Store() {
quotient_Float = posture_error/time;
if(value.getFloat("Value_Quotient", quotient_Float)==null || quotient_Float < value.getFloat("Value_Quotient", quotient_Float))
{
editor.putFloat("Value_Quotient", quotient_Float);
editor.commit();
}
}
Un 'float' non può essere' null'. Un 'Float' può essere' null'. La tua variabile è di tipo primitivo o di riferimento? –
http://docs.oracle.com/javase/tutorial/java/data/autoboxing.html –
È primitivo. –