diff options
author | Miroojin Bakshi <gaglu231094@gmail.com> | 2014-03-06 16:27:35 +0530 |
---|---|---|
committer | Miroojin Bakshi <gaglu231094@gmail.com> | 2014-03-06 16:27:35 +0530 |
commit | fab549c2b5cf637a4afc94c38f7745bfa733b316 (patch) | |
tree | 6f051cb4795ee4de8fc3b0d9f78aed7ec013cc84 /OpenPGP-Keychain/src/main | |
parent | 7932dd8a81345f4f4cc10a4618c8f0856d9f45d1 (diff) | |
download | open-keychain-fab549c2b5cf637a4afc94c38f7745bfa733b316.tar.gz open-keychain-fab549c2b5cf637a4afc94c38f7745bfa733b316.tar.bz2 open-keychain-fab549c2b5cf637a4afc94c38f7745bfa733b316.zip |
Use selectionArgs parameter to pass mCurquery.
Diffstat (limited to 'OpenPGP-Keychain/src/main')
2 files changed, 12 insertions, 8 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java index af5d946eb..95267e01f 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java @@ -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 diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java index e3e5c55fb..a43c84cf4 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java @@ -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 |