we need to check the API version of the device before making some of these calls

This commit is contained in:
Mike 2012-04-10 21:56:36 -04:00
parent 597cafd93c
commit ba20782784

View File

@ -228,23 +228,30 @@ public class SQLitePlugin extends Plugin {
try { try {
for (int i = 0; i < colCount; ++i) { for (int i = 0; i < colCount; ++i) {
key = cur.getColumnName(i); key = cur.getColumnName(i);
switch(cur.getType (i)) if(android.os.Build.VERSION.SDK_INT >= 11)
{ {
case Cursor.FIELD_TYPE_NULL: switch(cur.getType (i))
row.put(key, null); {
break; case Cursor.FIELD_TYPE_NULL:
case Cursor.FIELD_TYPE_INTEGER: row.put(key, null);
row.put(key, cur.getInt(i)); break;
break; case Cursor.FIELD_TYPE_INTEGER:
case Cursor.FIELD_TYPE_FLOAT: row.put(key, cur.getInt(i));
row.put(key, cur.getFloat(i)); break;
break; case Cursor.FIELD_TYPE_FLOAT:
case Cursor.FIELD_TYPE_STRING: row.put(key, cur.getFloat(i));
row.put(key, cur.getString(i)); break;
break; case Cursor.FIELD_TYPE_STRING:
case Cursor.FIELD_TYPE_BLOB: row.put(key, cur.getString(i));
row.put(key, cur.getBlob(i)); break;
break; case Cursor.FIELD_TYPE_BLOB:
row.put(key, cur.getBlob(i));
break;
}
}
else
{
row.put(key, cur.getString(i));
} }
} }
fullresult.put(row); fullresult.put(row);