いくつかの文字列と一緒に画像をデータベースに入力しようとしていますが、put メソッドで次のエラーが発生します。
The method put(String, String) in the type ContentValues is not applicable for the arguments (String, Byte[])
しかし、チュートリアルで見ると、私のやり方とまったく同じように行われているようです。
関連するコードは次のとおりです。
private static final String DATABASE_CREATE =
"CREATE Table " + DATABASE_TABLE_LIST + " ( "
+ LIST_ID + " integer PRIMARY KEY Autoincrement, "
+ LIST_NAME + " text NOT NULL, "
+ LIST_ADDRESS + " text NOT NULL, "
+ LIST_IMAGE + " BLOB );";
...
public long createItem(String name, String address, Byte[] image) {
ContentValues initialValues = new ContentValues();
initialValues.put(LIST_NAME, name);
initialValues.put(LIST_ADDRESS, address);
initialValues.put(LIST_IMAGE, image);
return mDb.insert(DATABASE_TABLE_LIST, null, initialValues);
}
文字列とバイト配列の配置に関係があるのではないかと思いますが、解決方法がわからず、グーグルで見つけることができません