Keep the same inflater in the AppListAdapter
This commit is contained in:
parent
e9abbfa743
commit
bd2e379073
@ -27,10 +27,13 @@ abstract public class AppListAdapter extends BaseAdapter {
|
|||||||
|
|
||||||
private List<DB.App> items = new ArrayList<DB.App>();
|
private List<DB.App> items = new ArrayList<DB.App>();
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
private LayoutInflater mInflater;
|
||||||
private DisplayImageOptions displayImageOptions;
|
private DisplayImageOptions displayImageOptions;
|
||||||
|
|
||||||
public AppListAdapter(Context context) {
|
public AppListAdapter(Context context) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
|
mInflater = (LayoutInflater) mContext.getSystemService(
|
||||||
|
Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
|
||||||
displayImageOptions = new DisplayImageOptions.Builder()
|
displayImageOptions = new DisplayImageOptions.Builder()
|
||||||
.cacheInMemory(true)
|
.cacheInMemory(true)
|
||||||
@ -83,8 +86,7 @@ abstract public class AppListAdapter extends BaseAdapter {
|
|||||||
DB.App app = items.get(position);
|
DB.App app = items.get(position);
|
||||||
|
|
||||||
if (convertView == null) {
|
if (convertView == null) {
|
||||||
convertView = ((LayoutInflater) mContext.getSystemService(
|
convertView = mInflater.inflate(R.layout.applistitem, null);
|
||||||
Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.applistitem, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TextView name = (TextView) convertView.findViewById(R.id.name);
|
TextView name = (TextView) convertView.findViewById(R.id.name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user