Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ItemAdapter extends BaseAdapter {
- private Context context;
- private String[] items;
- public ItemAdapter(Context context, String[] items) {
- this.context = context;
- this.items = items;
- }
- @Override
- public int getCount() {
- return 0;
- }
- @Override
- public Object getItem(int position) {
- return null;
- }
- @Override
- public long getItemId(int position) {
- return 0;
- }
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- View v = convertView;
- if (convertView == null){
- //Create a new view into the list
- LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- v = inflater.inflate(R.layout.list_item, parent, false);
- }
- TextView category = (TextView)v.findViewById(R.id.category);
- String item = this.items[position];
- category.setText(item);
- return v;
- }
- }
Add Comment
Please, Sign In to add comment