-1

this is my getview method of myadapterclass

public View getView(int position, View convertView, ViewGroup parent) { pos = position;

    ApplicationInfo entry = ai.get(position);
    String str = insatllApps.get(position);
    System.out.println("Position============"+(insatllApps.get(position)));
    //Log.d("Check>>:","size>>"+insatllApps.size());
    convertView = mInflater.inflate(R.layout.list__button, null);
    t1=(TextView)convertView.findViewById(R.id.textView1);
    iv=(ImageView)convertView.findViewById(R.id.imageView1);
    tb1=(ToggleButton)convertView.findViewById(R.id.togal);
    tb1.setOnClickListener(this);
    tb1.setTag(pos);
    tb1.setTag(R.id.togal, str);

    iv.setImageDrawable(entry.loadIcon(mPackManager));


    t1.setText(str);


            return convertView;
}
SubbaReddy PolamReddy
  • 2,083
  • 2
  • 17
  • 23
Raja
  • 61
  • 1
  • 7

1 Answers1

-1

well this is the solution that works

     View row=null
    ApplicationInfo entry = ai.get(position);
        String str = insatllApps.get(position);
        System.out.println("Position============"+(insatllApps.get(position)));
        //Log.d("Check>>:","size>>"+insatllApps.size());
        row= mInflater.inflate(R.layout.list__button, null);
        t1=(TextView)row.findViewById(R.id.textView1);
        iv=(ImageView)row.findViewById(R.id.imageView1);
        tb1=(ToggleButton)row.findViewById(R.id.togal);
        tb1.setOnClickListener(this);
        tb1.setTag(pos);
        tb1.setTag(R.id.togal, str);

        iv.setImageDrawable(entry.loadIcon(mPackManager));


        t1.setText(str);

return row 

create a new view in the getView method

Aashish Bhatnagar
  • 2,595
  • 2
  • 22
  • 37