After filter a listview,how can I obtain the position of the first listview? I use simpleadapter to fill the listview. Each item in the datasource has its own id,and I use
this happens becouse Android gives you only IDs for the itmes you currently see + maybe two hidden on button and two hidden on top.
In this tutorial you can see how to create a ListView with a model, this helps me, when i got this problem before. Add this to you code and change it (I think you don't need the checkboxes).
I slove it with three arrays. Only test code:
String positionString[]=new String[22];
int latterPosition[]=new int[22];
for (int i = 0; i < latterPosition.length; i++) {
positionString[i]="";
latterPosition[i]=0;
}
int latterCount=0;
for (int i = 0; i < positions.length; i++) {
if (positions[i]==10) {
positionString[latterCount]=i+"";
latterPosition[latterCount]=10;
latterCount++;
}
}