I have a custom file type/extension that I want to associate my app with.
As far as I know, the data element is made for this purpose, but I can\'t get it working. h
Read opening file in kotlin:
private fun checkFileOpening(intent: Intent) {
if (intent.action == Intent.ACTION_VIEW && (intent.scheme == ContentResolver.SCHEME_FILE
|| intent.scheme == ContentResolver.SCHEME_CONTENT)) {
val text = intent.data?.let {
contentResolver.openInputStream(it)?.bufferedReader()?.use(BufferedReader::readText)
}
}
}