catch exception of IntentGenerator.getTitle(...)

This commit is contained in:
Philipp Schaefer
2014-02-23 12:47:16 +01:00
parent b642ec2299
commit 58c68edb81
4 changed files with 14 additions and 14 deletions

View File

@@ -36,7 +36,12 @@ class IntentAdapter extends ArrayAdapter<Intent> {
final Intent item = getItem(position);
view.setText(IntentGenerator.getTitle(item));
try {
view.setText(IntentGenerator.getTitle(item));
} catch (IllegalArgumentException e) {
view.setText("unknown");
Log.w(e);
}
view.setCompoundDrawablePadding((int) getContext().getResources().getDimension(R.dimen.icon_margin));
// get icon and scale it manually to ensure that all have the same size