In which SDK, jar this class can be found? I need to check at runtime if an exception is an instance of it.
I know this class can be found in AOSP sources. But this doesn't help much in runtime.
In which SDK, jar this class can be found? I need to check at runtime if an exception is an instance of it.
I know this class can be found in AOSP sources. But this doesn't help much in runtime.
That is a hidden class in the Android SDK (see the Android 8.1 edition).
You can download the android sdk source, see this link:
With regards to checking the exception type at runtime, you can do the following (in Kotlin - transcribe to Java if required):
fun doSomething() {
try {
// Do something that may cause an exception
} catch (ex: KeyStoreException) {
}
}
or:
fun checkType() {
try {
// Something that could throw an exception
} catch(ex: Exception) {
when (ex) {
is KeyStoreException -> {
// Handle
}
}
}
}
This is a hidden class in Android . This can only be accessed by the framework or below layers and system apps , cannot be used by third party applications . You can check out the defination in the below link .
There are 3 such classes in Android . All the 3 are under different packages and used in different context .