// if you use this in Android 11(api 30)
// add this below lines in manifests
<queries>
<package android:name="strPackageName" />
</queries>
fun hasAnyApp(strPackageName: String): Boolean
{
val intent = packageManager.getLaunchIntentForPackage(strPackageName)
return intent != null
}
안도르이드 11 버전을 사용하는 경우 query를 작성해줘야 getLaunchIntentForPackage 함수가 정상적으로 작동합니다.
'프로그래밍 > Android, iOS' 카테고리의 다른 글
[Android] aar 파일 만드는 방법 (0) | 2022.03.29 |
---|---|
[Android] DrawerLayout with FrameLayout 삽질 (0) | 2022.03.29 |
[Android] 취약점 분석 정리 (0) | 2022.03.29 |
[Android Error] 사설 배포시 apk 파일 파싱 오류 (0) | 2022.03.29 |
[Android] Floating button으로 추가 버튼 만들기 (0) | 2022.03.29 |
댓글