mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-25 08:28:50 -05:00
Use selectionArgs parameter to pass mCurquery.
This commit is contained in:
parent
7932dd8a81
commit
fab549c2b5
@ -239,12 +239,14 @@ public class KeyListPublicFragment extends Fragment implements SearchView.OnQuer
|
|||||||
// sample only has one Loader, so we don't care about the ID.
|
// sample only has one Loader, so we don't care about the ID.
|
||||||
Uri baseUri = KeyRings.buildPublicKeyRingsUri();
|
Uri baseUri = KeyRings.buildPublicKeyRingsUri();
|
||||||
String where = null;
|
String where = null;
|
||||||
if(mCurQuery != null)
|
String whereArgs[] = null;
|
||||||
where = KeychainContract.UserIds.USER_ID + " LIKE \"" + mCurQuery + "%\"";
|
if(mCurQuery != null){
|
||||||
|
where = KeychainContract.UserIds.USER_ID + " LIKE ?";
|
||||||
|
whereArgs = new String[]{mCurQuery+"%"};
|
||||||
|
}
|
||||||
// Now create and return a CursorLoader that will take care of
|
// Now create and return a CursorLoader that will take care of
|
||||||
// creating a Cursor for the data being displayed.
|
// creating a Cursor for the data being displayed.
|
||||||
return new CursorLoader(getActivity(), baseUri, PROJECTION, where, null, SORT_ORDER);
|
return new CursorLoader(getActivity(), baseUri, PROJECTION, where, whereArgs, SORT_ORDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -226,13 +226,15 @@ public class SelectPublicKeyFragment extends ListFragmentWorkaround implements T
|
|||||||
orderBy = inMasterKeyList + " DESC, " + orderBy;
|
orderBy = inMasterKeyList + " DESC, " + orderBy;
|
||||||
}
|
}
|
||||||
String where = null;
|
String where = null;
|
||||||
if(mCurQuery != null)
|
String whereArgs[] = null;
|
||||||
where = UserIds.USER_ID + " LIKE \"" + mCurQuery + "%\"";
|
if(mCurQuery != null){
|
||||||
|
where = UserIds.USER_ID + " LIKE ?";
|
||||||
|
whereArgs = new String[]{mCurQuery+"%"};
|
||||||
|
}
|
||||||
|
|
||||||
// Now create and return a CursorLoader that will take care of
|
// Now create and return a CursorLoader that will take care of
|
||||||
// creating a Cursor for the data being displayed.
|
// creating a Cursor for the data being displayed.
|
||||||
return new CursorLoader(getActivity(), baseUri, projection, where, null, orderBy);
|
return new CursorLoader(getActivity(), baseUri, projection, where, whereArgs, orderBy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user