List of usage examples for android.database.sqlite SQLiteStatement bindBlob
public void bindBlob(int index, byte[] value)
From source file:Main.java
public static void bindValores(SQLiteStatement statement, ContentValues contentValues) { Set<String> chaves = new TreeSet<>(contentValues.keySet()); int index = 1; for (String chave : chaves) { Object valor = contentValues.get(chave); if (valor == null) { statement.bindNull(index);//from w w w. j av a 2s . c o m } else if (valor instanceof String) { statement.bindString(index, (String) valor); } else if (valor instanceof Double || valor instanceof Float) { statement.bindDouble(index, Double.valueOf(String.valueOf(valor))); } else if (valor instanceof Integer || valor instanceof Long) { statement.bindLong(index, Long.valueOf(String.valueOf(valor))); } else if (valor instanceof byte[]) { statement.bindBlob(index, (byte[]) valor); } index++; } }