Hi All,

I have developed an android application which is having list views.
Here i have two different pages (list view), which is having 6 and 150
list items. Right now i am in second page. It is having the 150 items.
Now i am scrolling the page, at the same time i am trying to navigate
different or previous page using the button action. That time I am
getting the crash. That means ArrayIndexOutOfBoundsException i am
getting. I am using the custom adapter to create list menu. Here is my
code,

private class CustomListAdapter extends BaseAdapter {
                Context context;
                public CustomListAdapter(Context context) {
                        this.context = context;
                }
                public int getCount() {
                        return toDisplay.length;
                }
                public Object getItem(int arg0) {
                        return toDisplay[arg0];
                }
                public long getItemId(int position) {
                        return 0;
                }
                public View getView(int position, View convertView, ViewGroup
parent) {
                        CustomListView view = null;

                        /*
                         My code here...
                         */
                        view = new CustomListView(context, sType, bmImg, 
position);
                        view.setGravity(Gravity.CENTER);
                        }
                        return view;
                }
        }

While coming navigating i am getting the problem in the following line
"public View getView(int position, View convertView, ViewGroup
parent)"
because I am getting the position value as greater than 6. So can any
one tell me how to resolve this.
I think the problem in list view scrolling. So before navigating to
other screen i have to stop the scrolling. How to do that?
Please let me know your suggestions.

Thanks in Advance,
Muthu Kumar K.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to