• 로그인 함 해보끄나?

  • Sarangnamu.net June 17, 2003
    Home Login Profile Study Open Project Q&A Google Code
    kotlin isForegroundApp
    Last Modify : 16 October, 2017(04:46)
    kotlin 을 통해 app 이 foreground 인지 아닌지 확인 한다. fun isForegroundApp(context: Context, pkgName: String): Boolean { val manager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager return manager.runningAppProcesses.filter { it.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND && it.processName == pkgName }.size == 1 }

    Comment


    입력하3 1513257821



    Locations of visitors to this page