Skip to content

Commit

Permalink
Fixed crashing for pre-jellybean devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Vorror authored and atermenji committed Jul 5, 2013
1 parent 26c264a commit 06ca6ea
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import static android.os.Build.VERSION.SDK_INT;
import static android.os.Build.VERSION_CODES.JELLY_BEAN;
import android.app.ListActivity;
import android.content.Context;
import android.content.Intent;
Expand Down Expand Up @@ -118,8 +119,11 @@ public View getView(int position, View convertView, ViewGroup parent) {
IconicFontDrawable iconicFontDrawable = new IconicFontDrawable(getContext());
iconicFontDrawable.setIcon(icon);
iconicFontDrawable.setIconColor(Utils.randomColor());
holder.icon.setBackground(iconicFontDrawable);

if (SDK_INT < JELLY_BEAN) {
holder.icon.setBackgroundDrawable(iconicFontDrawable);
} else {
holder.icon.setBackground(iconicFontDrawable);
}
return convertView;
}

Expand Down

0 comments on commit 06ca6ea

Please sign in to comment.