I'm trying to write a live wallpaper where objects are falling down from top to bottom. The problem is that on a tablet (I'm using a nexus 7 and a galaxy note) when screen orientation changes, my objects are no more falling down but they are going to the wrong direction (if a turn the device right they are falling right, if I turn it left they falls to the left, and so on..).
I'm using gravity sensor
mGravitySensor = mSensorManager.getDefaultSensor(Sensor.TYPE_GRAVITY);
and I calculate the square root of gravity along X and Y axis to move the objects.
How is it possible to make the objects always falling down? Thanks in advance!
I add an image to better explane this behavior.