Created
July 27, 2020 03:12
-
-
Save cdmunoz/b2d5d38eaea7188b90d11b6408e7d8db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(binding.root) | |
binding.cameraIcon.setOnClickListener { | |
openSettings() | |
} | |
} | |
private fun openSettings() { | |
Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply { | |
addCategory(Intent.CATEGORY_DEFAULT) | |
data = Uri.parse("package:$packageName") | |
}.run(::startActivity) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment