Checking for Device Compatibility
You can include PSPDFKit in applications that will be distributed to devices not supported by PSPDFKit. In such a case, PSPDFKit.initialize()
will throw PSPDFKitInitializationFailedException
, which you must catch and handle appropriately:
Copy
1 2 3 4 5 | try { PSPDFKit.initialize(context, LICENSE) } catch (e : PSPDFKitInitializationFailedException) { Log.e(LOG_TAG, "Current device is not compatible with PSPDFKit!") } |
Copy
1 2 3 4 5 | try { PSPDFKit.initialize(context, LICENSE); } catch (PSPDFKitInitializationFailedException e) { Log.e(LOG_TAG, "Current device is not compatible with PSPDFKit!"); } |