import android.app.Activity;
import android.content.Context;
+import android.content.pm.ActivityInfo;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
if (motion_speed != null && !motion_speed.isCancelled()) {
motion_speed.cancel();
mSensorManager.unregisterListener(accel);
+ this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
speed_item.setTitle("Start speed");
}
}
}
- @Override
+ @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.hokuyo_view);
motion_speed = new MotionSpeedPublish(mGravity.getMaximumRange(),appDomain);
motion_speed.start();
speed_item = item;
+ this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
item.setTitle("Stop speed");
}
else if (item.getTitle().equals("Stop speed")) {
mSensorManager.unregisterListener(accel);
motion_speed.cancel();
+ this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
item.setTitle("Start speed");
}
else if (item.getTitle().equals("Start hokuyo")) {