Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 뷰바인딩
- ButtonWithButton
- button
- firebasefunctions
- 안드로이드
- 코틀린
- 랜덤ID
- BottomSheetDialog
- Dialog
- textview
- Activity
- Kotlin
- OutlinedButton
- firebase
- Android
- androidstudio
- 팝업액티비티
- Imageview
- 안드로이드스튜디오
- FRAGMENT
- MaterialButton
- ROOM
- nav_graph
- EditText
- ViewModel
- lifecyclescope
- 안드로이드 스튜디오
- ArrayList
- 밑줄
- RealtimeDB
Archives
- Today
- Total
안드로이드 앱 개발
Ted Permission 라이브러리 (권한) 본문
1. Module:gradle에 implementation
implementation 'gun0912.ted:tedpermission:2.2.3'
2. 객체 생성 및 메서드 추가
PermissionListener permissionlistener = new PermissionListener() {
@Override
public void onPermissionGranted() {
Toast.makeText(MainActivity.this, "Permission Granted", Toast.LENGTH_SHORT).show();
}
@Override
public void onPermissionDenied(List<String> deniedPermissions) {
Toast.makeText(MainActivity.this, "Permission Denied\n" + deniedPermissions.toString(), Toast.LENGTH_SHORT).show();
}
};
3. 권한 물을 액티비티에 다음 추가
TedPermission.with(this)
.setPermissionListener(permissionlistener)
.setDeniedMessage("If you reject permission,you can not use this service\n\nPlease turn on permissions at [Setting] > [Permission]")
.setPermissions(Manifest.permission.READ_CONTACTS, Manifest.permission.ACCESS_FINE_LOCATION)
.check();