1. Erum Mirza's Avatar
    i have following code
    package com.example.erum.cart;

    import android.util.Log;
    import android.widget.ArrayAdapter;
    import android.app.Activity;
    import android.content.Context;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.ArrayAdapter;
    import android.widget.BaseAdapter;
    import android.widget.CheckBox;
    import android.widget.TextView;
    import java.util.ArrayList;

    import android.content.Context;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.BaseAdapter;
    import android.widget.TextView;

    import java.util.ArrayList;

    /**
    * Created by erum on 5/15/2016.
    */
    public class MyCustomAdapter extends BaseAdapter {
    private ArrayList<item> objects;
    LayoutInflater lInflater;
    // ArrayList<item> contactList;
    // Context context;

    // public MyCustomAdapter(Context context, int resource,ArrayList<item> tasklist) {
    // public MyCustomAdapter(Context context, int textViewResourceId, ArrayList<item> objects) {
    Context context;
    // ArrayList<com.example.erum.cart.item> contactList;

    public MyCustomAdapter(Context context, ArrayList<com.example.erum.cart.item> list) {

    this.context = context;

    objects = list;
    lInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }

    @Override
    public int getCount() {
    return objects.size();
    }

    @Override
    public Object getItem(int position) {
    return null;
    }

    @Override
    public long getItemId(int position) {
    return 0;
    }

    public View getView(int position, View convertView, ViewGroup arg2) {

    // ContactListItems contactListItems = contactList.get(position);

    if (convertView == null) {
    /* LayoutInflater inflater = (LayoutInflater) context
    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    convertView = inflater.inflate(R.layout.itemlistinfo, null);*/
    convertView = lInflater.inflate(R.layout.itemlistinfo, arg2, false);

    }
    item contactListItems = objects.get(position);
    //TextView tvSlNo = (TextView) convertView.findViewById(R.id.tv_slno);
    // tvSlNo.setText(contactListItems.getSlno());
    TextView tvName = (TextView) convertView.findViewById(R.id.title);
    tvName.setText(contactListItems.getTitle());
    // Log.e(contactListItems.getTitle());
    // TextView tvPhone = (TextView) convertView.findViewById(R.id.tv_phone);
    // tvPhone.setText(contactListItems.getPhone());

    return convertView;
    }
    static class ViewHolder {
    TextView name;
    CheckBox cb;
    }

    }

    but its not binding with textview title any help
    05-23-2016 09:51 AM

Similar Threads

  1. How to go into Recovery Mode LG V10?
    By AlwaysSmile in forum LG V10
    Replies: 18
    Last Post: 09-15-2016, 12:43 PM
  2. Replies: 1
    Last Post: 06-02-2016, 01:45 AM
  3. Why can't I wake up my phone since upgrade to Marshmallow
    By AC Question in forum Ask a Question
    Replies: 12
    Last Post: 05-25-2016, 04:28 PM
  4. how do i get the marshmallow update for blu studio hd 6.0
    By AC Question in forum Ask a Question
    Replies: 1
    Last Post: 05-25-2016, 02:48 AM
  5. Replies: 1
    Last Post: 05-23-2016, 09:20 AM
LINK TO POST COPIED TO CLIPBOARD