0
を更新していません。この時点で表が作成されます。 the remote shellを使用してDBにUpdate関数は、私は私のコンテンツプロバイダで働い更新方法は、更新は0を返し、テーブルに更新された情報はありません取得するために苦労していたデータベース
message = "Player 1 wins";// we should get the name
ContentValues mUpdateValues = new ContentValues();
String[] projectionFields = new String[] {
LeagueContract.COLUMN_NAME_SCORE };
Uri uri = ContentUris.withAppendedId(LeagueContentProvider.LEAGUE_URI, player1Id);
ContentResolver content = getContentResolver();
Cursor cursor = content.query(uri, projectionFields, null, null, null);
cursor.moveToFirst();
int score = cursor.getInt(0);
score ++;
ContentValues values = new ContentValues();
values.put(LeagueContract.COLUMN_NAME_SCORE,score);
content.update(uri,values,null,null);
すべてがうまく見えます。あなたはプレイヤーIDを確認しましたか? –
はい、それは、データの細かさからスコアを引き出します。だから、player1Idは正しい。私はそれがすべて見えて本当に問題を見ることができないと思った! –
問題が解決しました.COLUMN_KEY_IDは整数で、列のタイトルが使用されていました。 –