开发者

list is not clickable when i scroll down in list view

开发者 https://www.devze.com 2023-04-04 13:02 出处:网络
iam displaying items in listview and when i click on list navigate to next activity but when i scroll down in list view and then click on list its not work means list is not clicking i am very wonderi

i am displaying items in listview and when i click on list navigate to next activity but when i scroll down in list view and then click on list its not work means list is not clicking i am very wondering why this happening..pls some help me thanks. my code..for showing in list view is...

class MyAdapter extends BaseAdapter implements OnClickListener
{
    private LayoutInflater inflater;
    public MyAdapter(Context ctx) {
    super();
    this.inflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }        

    @Override
    public int getCount() {
        return totalartist;
    }

   /* Not implemented but not really needed */
    @Override
    public Object getItem(int position) {
        return null;
    }

   /* Not implemented but not really needed */
    @Override
    public long getItemId(int position) { 
        return 0;
    }

    @Override
    public View getView(int position, View ConvertView, ViewGroup parent) 
    {
       View v = inflater.inflate(R.layout.listitem_layout, parent, false);
       // Log.i("array galoijewdh..",keywordresu开发者_高级运维lttab.array_galleryname[position]);
       // Variables.a=3;
       try{
           String   gallerynames = keywordsearch.array_galleryname[position];
           String  addresses = keywordsearch.array_address[position];            
           TextView tv = (TextView) v.findViewById(R.id.barrio);
           tv.setText(gallerynames);
           tv = (TextView) v.findViewById(R.id.ciudad);
           tv.setText(addresses);
           ((BaseAdapter)(getListAdapter())).notifyDataSetChanged();
       // return v;
    }catch(NullPointerException e){}
         return v;
    }
    @Override
    public void onClick(DialogInterface dialog, int which) 
    {

    }

    }
}


Refer this tutorial

problem seems to be in your view the way you are using.

0

精彩评论

暂无评论...
验证码 换一张
取 消