|
@@ -193,9 +193,13 @@ abstract class ReaderActivity : AppCompatActivity() {
|
|
|
}
|
|
|
insertToRecentDocumentList(filePath as String)
|
|
|
}
|
|
|
- val result = viewModel.openPdfFile(applicationContext, Uri.parse(filePath), password, Runnable { requestPassword() }, intent.type)
|
|
|
- if (result == ReaderViewModel.OpenFileResult.FAILED) {
|
|
|
- Toast.makeText(this, getString(R.string.cannot_open_file_Path, filePath), Toast.LENGTH_LONG).show()
|
|
|
+ if (filePath.isNullOrEmpty()) {
|
|
|
+ Toast.makeText(this, getString(R.string.cannot_open_buffer), Toast.LENGTH_LONG).show()
|
|
|
+ } else {
|
|
|
+ val result = viewModel.openPdfFile(applicationContext, Uri.parse(filePath), password, Runnable { requestPassword() }, intent.type)
|
|
|
+ if (result == ReaderViewModel.OpenFileResult.FAILED) {
|
|
|
+ Toast.makeText(this, getString(R.string.cannot_open_file_Path, filePath), Toast.LENGTH_LONG).show()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
setupLeftToolbar()
|