Det er fordi du passerer listevisningselementets position, det skal være databaserække-id'et.
Skift
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
showsDialog(position);
}
til
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
TextView pos = (TextView) view.findViewById(R.id.rowno);
showsDialog(pos.getText().toString());
}
Du sagde også
Once I delete any entry the row id on the listview doesn't seem to update the row number. (if i delete the first row, the row on top shows 2(should be 1, as it is the new first row)).
Men det ville det ikke, fordi dette er databaserækken, der ikke er listevisningspositionen.