Update to androidx.fragment:fragment:1.3.0-alpha08: registerForActivityResult not allowed after onCreate anymore. How to use after onCreate?

It just means that you shouldn’t register the callback after onCreate(). So you can do this private val checkPermission = registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { … } and then launch the check anytime you need it checkPermission.launch(array-of-permissions) The reason: When starting an activity for a result, it is possible (and, in cases of memory-intensive operations such as camera … Read more

Jetpack Compose: Launch ActivityResultContract request from Composable function

As of androidx.activity:activity-compose:1.3.0-alpha06, the registerForActivityResult() API has been renamed to rememberLauncherForActivityResult() to better indicate the returned ActivityResultLauncher is a managed object that is remembered on your behalf. val result = remember { mutableStateOf<Bitmap?>(null) } val launcher = rememberLauncherForActivityResult(ActivityResultContracts.TakePicturePreview()) { result.value = it } Button(onClick = { launcher.launch() }) { Text(text = “Take a picture”) } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)