marcshilling / react-native-idle-timer

A cross-platform bridge that allows you to enable and disable the screen idle timer in your React Native app
MIT License
216 stars 41 forks source link

Error in IdleTimerManager.java #34

Open ErYogeshPatil opened 1 year ago

ErYogeshPatil commented 1 year ago

public static void deactivate(@NotNull final Activity activity, final String tag) { ^ symbol: class NotNull location: class IdleTimerManager

error in this code in IdleTimerManager.java

public static void activate(@NotNull final Activity activity, final String tag) { if (tags.isEmpty()) { activity.runOnUiThread(() -> { activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); }); } tags.add((tag == null ? "" : tag)); }

public static void deactivate(@NotNull final Activity activity, final String tag) {
    if (tags.size() == 1 && tags.contains((tag))) {
        activity.runOnUiThread(() -> {
            activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        });
    }
    tags.remove((tag == null ? "" : tag));
}