diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3cd3cc6..3406f68 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -7,6 +7,7 @@ + diff --git a/app/src/main/java/top/itning/yunshuclassschedule/ui/activity/ShareActivity.kt b/app/src/main/java/top/itning/yunshuclassschedule/ui/activity/ShareActivity.kt index e355cc8..d6b9511 100644 --- a/app/src/main/java/top/itning/yunshuclassschedule/ui/activity/ShareActivity.kt +++ b/app/src/main/java/top/itning/yunshuclassschedule/ui/activity/ShareActivity.kt @@ -194,11 +194,11 @@ class ShareActivity : BaseActivity() { return } Log.d(TAG, "File Uri: $uri") - val openInputStream = contentResolver.openInputStream(uri) ?: kotlin.run { - Toast.makeText(this, "解析失败", Toast.LENGTH_LONG).show() - return - } try { + val openInputStream = contentResolver.openInputStream(uri) ?: kotlin.run { + Toast.makeText(this, "解析失败", Toast.LENGTH_LONG).show() + return + } val inputAsString = openInputStream.bufferedReader().use { it.readText() } val dataEntity = Gson().fromJson(inputAsString, DataEntity::class.java) val classScheduleList = dataEntity.classScheduleList