Android/Kotlin22 권한 요청 및 수락 class MainActivity : AppCompatActivity() { private val requestPermission = registerForActivityResult( ActivityResultContracts.RequestPermission() ) { if (it) { Toast.makeText(applicationContext, "수락", Toast.LENGTH_SHORT).show() } else { Toast.makeText(applicationContext, "거절", Toast.LENGTH_SHORT).show() } } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) s.. 2022. 8. 9. let 뜻 it.data?.let{ // Do something, if it.data is not null } ?.let 이게 뭔가 했더니 null이 아닐 때 Bracket 안의 코드를 수행한다. 2022. 8. 9. You need to use a Theme.AppCompat theme (or descendant) with this activity. 수정 You need to use a Theme.AppCompat theme (or descendant) with this activity. 라며.. AlertDialog를 띄울 때 앱이 죽는 현상이 있었다. val builder = AlertDialog.Builder(applicationContext) // 이러면 에러 발생 val builder = AlertDialog.Builder(this) // 이러면 정상 동작 위 처럼 this로 변경해주면 잘 동작한다. 2022. 8. 8. Override한 메소드에서 overrides nothing 에러가 날 때 그럴땐 Parameter의 Null check를 지워주면 된다. 2022. 7. 31. 이전 1 2 3 4 5 6 다음