|
|
|
@ -991,17 +991,21 @@ class MainActivity : AppCompatActivity() {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
contentResolver.openInputStream(uri)?.use { inputStream ->
|
|
|
|
|
BufferedReader(InputStreamReader(inputStream)).use { reader ->
|
|
|
|
|
var i = ""
|
|
|
|
|
if (reader.ready()) {
|
|
|
|
|
i = reader.readLine()
|
|
|
|
|
var line: String? = ""
|
|
|
|
|
while (line != null) {
|
|
|
|
|
i += line + '\n'
|
|
|
|
|
line = reader.readLine()
|
|
|
|
|
CoroutineScope(Dispatchers.Main).launch {
|
|
|
|
|
withContext(Dispatchers.IO) {
|
|
|
|
|
contentResolver.openInputStream(uri)?.use { inputStream ->
|
|
|
|
|
BufferedReader(InputStreamReader(inputStream)).use { reader ->
|
|
|
|
|
var i = ""
|
|
|
|
|
if (reader.ready()) {
|
|
|
|
|
i = reader.readLine()
|
|
|
|
|
var line: String? = ""
|
|
|
|
|
while (line != null) {
|
|
|
|
|
i += line + '\n'
|
|
|
|
|
line = reader.readLine()
|
|
|
|
|
}
|
|
|
|
|
mdeValue = metaData.extractMetadataFromMarkdown(i)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
mdeValue = metaData.extractMetadataFromMarkdown(i)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|