I have two application application A and application B. From A I am saving an image, two string values into the database by using contentProvider.
From the application B i am accessing this database and getting the image. The code which i am using is given below
byte b[] = null;
Cursor c = mContext.getContentResolver().query(allTitles, projection,null, null, null);
if (c.moveToFirst()) {
do{
if(info.activityInfo.name != null) {
if(c.getString(1).equals(info.activityInfo.name)){
b=c.getBlob(0);
}
}
} while (c.moveToNext());
}
c.close();
Here in the selection area i am giving null so i am getting all the values in the database and i have to run this loop. Instead of that I want to give a where clause to get the exact raw.
Cursor c = mContext.getContentResolver().query(allTitles, projection,"activity_name ="+info.activityInfo.name, null, null);
So i have changed like this but it does not worked. How i should give the selection args ? Please help.
try..
in case if activity_name is text