I need help designing an Adapter for my GridView. I have an StringArray
inside my strings.xml
with about 100 items. I have this so far, but Im not sure what to put in the constructor to link my StringArray to this Adapter.
public class Tab01_FavAdapter extends BaseAdapter {
private Context mContext;
private LayoutInflater mInflator;
public Tab01_FavAdapter (Context c) {
mContext = c;
mInflator = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
return .size();
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null) {
convertView = mInflator.inflate(R.layout.griditemlayout, parent, false);
}
...
return convertView;
}
}