我在 mainflutteractivity 中有这个代码
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
when (requestCode) {
REQUEST_PERMISSION_LOCATIONS ->
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
doTransmitBeacon()
} else {
Toast.makeText(this, "Access Location Denied", Toast.LENGTH_SHORT).show()
}
}
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
}
代码在我使用库 https://pub.dev/packages/get_phone_number/example 之前正常运行
使用库 get_phone_number
后出现此错误
java.lang.RuntimeException: 传递结果失败 结果信息{who=@android:requestPermissions:, request=9001, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS(有 附加)}} 到活动 {com.cashbac.biz/com.cashbac.biz.MainFlutterActivity}: java.lang.IllegalStateException: 回复已经提交