Why does IDE swear?
val intent = Intent() //Expecting an element intent.action = packageName.plus(".granted") intent.putExtra(Constants.GRANT_NAME, Manifest.permission.CAMERA) sendBroadcast(intent)//Unexpected tokens (use ';' to separate expressions on the same line)
Why in this case there are such errors? What's wrong?
ps And it works
LocalBroadcastManager.getInstance(this) .sendBroadcast(Intent(packageName.plus(".granted")) .putExtra(Constants.GRANT_NAME, Manifest.permission.CAMERA))
sendBroadcast
method you callthis
in the first case. - Eugene Krivenja