Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 1.1 KB

README.md

File metadata and controls

39 lines (26 loc) · 1.1 KB

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.