case com.android.internal.R.styleable.TextAppearance_fontFamily:
try {
fontTypeface = appearance.getFont(attr);
- } catch (UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException | Resources.NotFoundException e) {
// Expected if it is not a font resource.
}
if (fontTypeface == null) {
case com.android.internal.R.styleable.TextView_fontFamily:
try {
fontTypeface = a.getFont(attr);
- } catch (UnsupportedOperationException e) {
- // Expected if it is not a font resource.
+ } catch (UnsupportedOperationException | Resources.NotFoundException e) {
+ // Expected if it is not a resource reference or if it is a reference to
+ // another resource type.
}
if (fontTypeface == null) {
fontFamily = a.getString(attr);
String fontFamily = null;
try {
fontTypeface = ta.getFont(R.styleable.TextAppearance_fontFamily);
- } catch (UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException | Resources.NotFoundException e) {
// Expected if it is not a font resource.
}
if (fontTypeface == null) {