In this method I return a value of the type Double, but there is an error saying “Method
Must return value of type Double”???
Code:
public class Gyro extends Activity {
Double gyro_X;
Double gyro_Y;
Double gyro_Z;
public Double getGyro_X() {
if (this.gyro_X == null) {
Toast.makeText(this, ""+gyro_XIsNullText, ToastdurationShort).show();
} else {
return this.gyro_X;
}
}
If
this.gyro_xisnullyou don’t return anything…Your code should be something like