code: public static boolean queryIsEmpty(SQLiteDatabase db, String table) {
          long isEmpty = longForQuery(db, "select exists(select 1 from " + table + ")", null);
          return isEmpty == 0;
      }
docs: Query the table to check whether a table is empty or not
  @param db the database the table is in
  @param table the name of the table to query
  @return True if the table is empty
  @hide