Skip to content

zyc945/AppVisibilityDetector

Repository files navigation

AppVisibilityDetector

purpose

detect app visibility status

feature

  • auto detect the app go to background

  • auto detect the app go to foreground

    the screen turn around is also in consideration, you don't need to handle it your self

how to use

AppVisibilityDetector implement in one java file, download AppVisibilityDetector.java and add to you project may be the easiest way to use. I'll build a aar for gradle used later.

used examples:

    AppVisibilityDetector.init(MyApp.this, new AppVisibilityCallback() {
        @Override
        public void onAppGotoForeground() {
            //app is from background to foreground
        }
        @Override
        public void onAppGotoBackground() {
            //app is from foreground to background
        }
    });

the MyApp is your Application class.

public class MyApp extends Application { ... }

License

This library is distributed under the Apache 2.0 license.

About

detect app background or foreground status

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages