is Accelerometer Rotation - Android android.app

Android examples for android.app:Application

Description

is Accelerometer Rotation

Demo Code

import android.app.Application;
import android.content.ContentResolver;
import android.provider.Settings;

public class Main{

    private static final String TAG = "";
    public static boolean isAccelerometerRotation(Application application) {
        if (application == null) {
            return false;
        }/*from  ww  w.  jav  a  2s  . c  o  m*/

        try {
            ContentResolver content = application.getContentResolver();

            int mode = Settings.System.getInt(content,
                    Settings.System.ACCELEROMETER_ROTATION);

            if (mode == 1) {
                return true;
            }
        } catch (Exception e) {
        }

        return false;
    }

}

Related Tutorials