Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.app.Activity;
import android.provider.Settings;
import android.util.Log;

public class Main {
    public static int GetAutorotateSetting(Activity activity) {
        int setting = 0;
        try {
            setting = Settings.System.getInt(activity.getContentResolver(), Settings.System.ACCELEROMETER_ROTATION);
        } catch (Exception e) {
            Log.i("RotationLockUtil", "Couldn't retrieve auto rotation setting: " + e.getMessage());
        }
        return setting;
    }
}