I want to change the screen orientation from portrait to landscape and vice versa when the user rotates his Android mobile phone clockwise/anticlockwise. Can anyone help me how
public class Accelerometer extends Activity implements AccelerometerListener{ public void onShake(float force) { Toast.makeText(this, "Phone shaked : " + force, 1000).show(); } }
You can refer to below link
http://blog.androgames.net/85/android-accelerometer-tutorial/