와이파이1 코틀린 네트워크 상태 체크 fun getNetWorkStatusCheck(context : Context) : Boolean { val connectManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager val networkStatus : NetworkInfo? = connectManager.activeNetworkInfo val connectCheck : Boolean = networkStatus?.isConnectedOrConnecting == true return connectCheck } when(getNetWorkStatusCheck(applicationContext)){ true -> //네트워크 연결됨 false-> .. 2022. 2. 4. 이전 1 다음