Here you can find the source of isCompanyInTour(SQLiteDatabase db, long companyId, long tourId)
public static boolean isCompanyInTour(SQLiteDatabase db, long companyId, long tourId)
//package com.java2s; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; public class Main { protected final static String TOUR_POINT_TABLE_NAME = "TourPoint"; protected final static String TOUR_POINT_TOUR_ID = "tourId"; protected final static String TOUR_POINT_COMPANY_ID = "companyId"; public static boolean isCompanyInTour(SQLiteDatabase db, long companyId, long tourId) { Cursor cursor = db.query( true,//from w w w .j a v a2s. c o m TOUR_POINT_TABLE_NAME, new String[] { TOUR_POINT_TOUR_ID, TOUR_POINT_COMPANY_ID }, TOUR_POINT_TOUR_ID + "=? " + " AND " + TOUR_POINT_COMPANY_ID + "=?", new String[] { Long.toString(tourId), Long.toString(companyId) }, null, null, null, null); cursor.moveToFirst(); if (cursor.getCount() >= 1) { return true; } else { return false; } } }