mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-14 15:32:27 +02:00
catch and show exceptions thrown at printing
This commit is contained in:
parent
71da396e08
commit
4ebf1f4a4a
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user