mirror of
https://github.com/FossifyOrg/Notes.git
synced 2026-09-17 00:13:33 -04:00
catch and show exceptions thrown at printing
This commit is contained in:
1 parent
71da396e08
commit
4ebf1f4a4a
1 file changed
+5
-1
@@ -1169,7 +1169,11 @@ class MainActivity : SimpleActivity() {
|
||||
val printAdapter = webView.createPrintDocumentAdapter(jobName)
|
||||
|
||||
(getSystemService(Context.PRINT_SERVICE) as? PrintManager)?.apply {
|
||||
print(jobName, printAdapter, PrintAttributes.Builder().build())
|
||||
try {
|
||||
print(jobName, printAdapter, PrintAttributes.Builder().build())
|
||||
} catch (e: IllegalStateException) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user