tags:

views:

24

answers:

1

friend's i have listview with 10 records parsed initially from internet and i have footer at bottom of my listview by using for click more to view,the view getting ok but the problem here is during my click event i have to call the same adapter class with different url it getting parsed well,the problem is click event adapter data are not binded with listview,i'm getting error has like this..

09-02 21:02:15.042: ERROR/AndroidRuntime(424): java.lang.IndexOutOfBoundsException: Invalid location 58, size is 1 09-02 21:02:15.042: ERROR/AndroidRuntime(424): at java.util.ArrayList.get(ArrayList.java:353)

here my java code initially executing....

LayoutInflater inflater2 = this.getLayoutInflater();
        View footerView = inflater2.inflate(R.layout.footer, null);
        footerView.findViewById(R.id.text1);

//      ((ListView) adapter).

    //  setListAdapter(adapter);

        adapter = new Adapter(Expand.this,url);
        getListView().addFooterView(footerView);    
        setListAdapter(adapter);

code at my footer click event ...

footerView.findViewById(R.id.text1).setOnClickListener(new OnClickListener(){
        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub

//

int  a = adapter.count;
                    len =100;
//                  Log.v("Count",Integer.toString(a));
                    url = "http://www.artistdirect.com/nad/rss/top100/0,,,00.xml";
                    adapter = new Adapter(Expand.this,url);
    adapter.notifyDataSetChanged();
}

how can i resolve it,is there any otherway to place link to view more and bind it on listview.

Thanks in advance.

A: 

I think that url is invalid...or it will return null values, check your url...

Kandhasamy
hi..this url is valid only it has parsed well but the previous content has gone and newly parsed url content is listing in listview..but i need to have previous content to bind with click event content.
MGSenthil
you are creating new adapter for every click event...you need to append the arraylist to show the previous and new content
Kandhasamy