sql >> データベース >  >> RDS >> SQLite

sqliteの行IDがlistviewと一致しません-ANDROID

    リストビューアイテムの位置を渡すため、データベースの行IDである必要があります。

    変更

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id)
    {
        showsDialog(position);
    }
    

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id)
    {
        TextView pos = (TextView) view.findViewById(R.id.rowno);
        showsDialog(pos.getText().toString());
    }
    

    またあなたは言った

    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)).
    

    ただし、これはデータベースの行IDであり、リストビューの位置ではないためではありません。



    1. PDOは最後に挿入されたIDを取得します

    2. RowDataPacketオブジェクトにアクセスする方法

    3. MySQLのMIN()とLEAST():違いは何ですか?

    4. SQL Server 2008 Spatial:ポリゴン内のポイントを検索します