mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-25 00:18:51 -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.
|
||||
Uri baseUri = KeyRings.buildPublicKeyRingsUri();
|
||||
String where = null;
|
||||
if(mCurQuery != null)
|
||||
where = KeychainContract.UserIds.USER_ID + " LIKE \"" + mCurQuery + "%\"";
|
||||
|
||||
String whereArgs[] = null;
|
||||
if(mCurQuery != null){
|
||||
where = KeychainContract.UserIds.USER_ID + " LIKE ?";
|
||||
whereArgs = new String[]{mCurQuery+"%"};
|
||||
}
|
||||
// Now create and return a CursorLoader that will take care of
|
||||
// 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
|
||||
|
@ -226,13 +226,15 @@ public class SelectPublicKeyFragment extends ListFragmentWorkaround implements T
|
||||
orderBy = inMasterKeyList + " DESC, " + orderBy;
|
||||
}
|
||||
String where = null;
|
||||
if(mCurQuery != null)
|
||||
where = UserIds.USER_ID + " LIKE \"" + mCurQuery + "%\"";
|
||||
|
||||
String whereArgs[] = null;
|
||||
if(mCurQuery != null){
|
||||
where = UserIds.USER_ID + " LIKE ?";
|
||||
whereArgs = new String[]{mCurQuery+"%"};
|
||||
}
|
||||
|
||||
// Now create and return a CursorLoader that will take care of
|
||||
// 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
|
||||
|
Loading…
Reference in New Issue
Block a user