FileDocCategorySizeDatePackage
DatabaseUtilsCompat.javaAPI DocAndroid 5.1 API1925Thu Mar 12 22:22:56 GMT 2015android.support.v4.database

DatabaseUtilsCompat

public class DatabaseUtilsCompat extends Object
Helper for accessing features in {@link android.database.DatabaseUtils} introduced after API level 4 in a backwards compatible fashion.

Fields Summary
Constructors Summary
private DatabaseUtilsCompat()

        /* Hide constructor */
    
Methods Summary
public static java.lang.String[]appendSelectionArgs(java.lang.String[] originalValues, java.lang.String[] newValues)
Appends one set of selection args to another. This is useful when adding a selection argument to a user provided set.

        if (originalValues == null || originalValues.length == 0) {
            return newValues;
        }
        String[] result = new String[originalValues.length + newValues.length ];
        System.arraycopy(originalValues, 0, result, 0, originalValues.length);
        System.arraycopy(newValues, 0, result, originalValues.length, newValues.length);
        return result;
    
public static java.lang.StringconcatenateWhere(java.lang.String a, java.lang.String b)
Concatenates two SQL WHERE clauses, handling empty or null values.

        if (TextUtils.isEmpty(a)) {
            return b;
        }
        if (TextUtils.isEmpty(b)) {
            return a;
        }

        return "(" + a + ") AND (" + b + ")";