mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-25 07:51:48 -05:00
Fix crash with NotFoundException
This commit is contained in:
parent
1e5797387a
commit
e1b0908290
@ -22,6 +22,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.database.CursorJoiner;
|
import android.database.CursorJoiner;
|
||||||
import android.database.MatrixCursor;
|
import android.database.MatrixCursor;
|
||||||
@ -207,7 +208,7 @@ public class AppsListFragment extends ListFragment implements
|
|||||||
null,
|
null,
|
||||||
isInstalled(packageName),
|
isInstalled(packageName),
|
||||||
1, // registered!
|
1, // registered!
|
||||||
0 // icon is retrieved later
|
R.drawable.ic_launcher // icon is retrieved later
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -229,7 +230,7 @@ public class AppsListFragment extends ListFragment implements
|
|||||||
name,
|
name,
|
||||||
isInstalled(packageName),
|
isInstalled(packageName),
|
||||||
1, // registered!
|
1, // registered!
|
||||||
0 // icon is retrieved later
|
R.drawable.ic_launcher // icon is retrieved later
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -336,7 +337,11 @@ public class AppsListFragment extends ListFragment implements
|
|||||||
text.setText(packageName);
|
text.setText(packageName);
|
||||||
} else {
|
} else {
|
||||||
text.setText(name);
|
text.setText(name);
|
||||||
|
try {
|
||||||
icon.setImageDrawable(getResources().getDrawable(iconResName));
|
icon.setImageDrawable(getResources().getDrawable(iconResName));
|
||||||
|
} catch (Resources.NotFoundException e1) {
|
||||||
|
// silently fail
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user