logical problem in an android app
hi i would like to know solution for such a problem..... i have an xml file containing users data of around 1000 users listed out in alphabetical order. The xml file use to be as follow

    <usersdata>
        <user>
             <id>1</id>
             <firstname>A</firstname>
             <middlename>AA</middlename>
             ......
             ......
        </user>
        <user>
             <id>2</id>
             <firstname>B</firstname>
              <middlename>BB</middlename>
               ......
               ......
        </user>
        ........
        ........
    </usersdata>


Now from the above xml file i am parsing all the tags and storing them in an array list for each tag. I am listing out the Firstname in a listview, by array list of first name. When the any of the list is clicked, it opens up a new activity where the all other details of the selected name is been shown.

For example if third name in the list is clicked, by using its `position(example 3)`, in the next activity i am listing out the third values stored in all the array lists i am using. This is what currently i am doing.

Now the problem is i have a edit box above the list view, named as a search box. If the letter `S` is typed in it, then all the names starting with S gets listed first. Opening the next activity by clicking the list now gets some wrong data, how to avoid this. 

Please give me a suggestion....


For example if the first name `C` is clicked, it will be listed at position 3 
logical problem in an android app
===

hi i would like to know solution for such a problem..... i have an xml file containing users data of around 1000 users listed out in alphabetical order. The xml file use to be as follow

    <usersdata>
        <user>
             <id>1</id>
             <firstname>A</firstname>
             <middlename>AA</middlename>
             ......
             ......
        </user>
        <user>
             <id>2</id>
             <firstname>B</firstname>
              <middlename>BB</middlename>
               ......
               ......
        </user>
        ........
        ........
    </usersdata>


Now from the above xml file i am parsing all the tags and storing them in an array list for each tag. I am listing out the Firstname in a listview, by array list of first name. When the any of the list is clicked, it opens up a new activity where the all other details of the selected name is been shown.

For example if third name in the list is clicked, by using its `position(example 3)`, in the next activity i am listing out the third values stored in all the array lists i am using. This is what currently i am doing.

Now the problem is i have a edit box above the list view, named as a search box. If the letter `S` is typed in it, then all the names starting with S gets listed first. Opening the next activity by clicking the list now gets some wrong data, how to avoid this. 

Please give me a suggestion....


For example if the first name `C` is clicked, it will be listed at position 3 