Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.os.Build;
import android.os.PowerManager;

public class Main {
    @SuppressWarnings("deprecation")
    public static boolean isInteractive(PowerManager pm) {
        boolean result = false;

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
            result = pm.isInteractive();
        } else {
            result = pm.isScreenOn();
        }

        return result;
    }
}