public void onSensorChanged(SensorEvent event) {
{
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
x = (int) Math.pow(event.values[1], 2);
// y = (int) Math.pow(sensorEvent.values[1], 2);
//Log.i(tag, "Get_Angle onSensorChanged..X is.." + x);
txtanglex.setText(x.toString());
//txtangley.setText(y.toString());
getAccelerometer(event);
}
if (event.sensor.getType() == Sensor.TYPE_ORIENTATION) {
}
//init();
}
}
{
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
x = (int) Math.pow(event.values[1], 2);
// y = (int) Math.pow(sensorEvent.values[1], 2);
//Log.i(tag, "Get_Angle onSensorChanged..X is.." + x);
txtanglex.setText(x.toString());
//txtangley.setText(y.toString());
getAccelerometer(event);
}
if (event.sensor.getType() == Sensor.TYPE_ORIENTATION) {
}
//init();
}
}