Sorry if this is a dumb question, but how do I catch this particular exception in my code? i.e, in my Catch block, what should be the catch keyword?
You can use catch(Resources.NotFoundException e)
. The $
in your stack trace just means NotFoundException
is a nested class in Resources
.
You could import the fully qualified class for NotFoundException
- that is, android.content.res.Resources.NotFoundException
- and just use NotFoundException
in the catch
, but it's arguably better for readability and comprehension to include the containing class for such a generically named Exception
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With