private ActivityResultLauncher<String> requestPermissionLauncher =
registerForActivityResult(new RequestPermission(),
isGranted -> {
if (isGranted) {
// Permission is granted. Continue the action or workflow in your
app.
} else {
// Explain to the user that the feature is unavailable because the
// feature requires a permission that the user has denied. At the
// same time, respect the user's decision. Don't link to system
// settings in an effort to convince the user to change their
// decision.
}
});
2条答案
按热度按时间yshpjwxd1#
这样请求:
检查结果如下:
你可以把22号改成任何你想要的号码。
p8h8hvxi2#
希望它会有帮助!!