aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
diff options
context:
space:
mode:
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
index 3d2e8b9df..63a1aade9 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
@@ -101,7 +101,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView
/*if (completionText.startsWith("0x")) {
}*/
- return null;
+ return "";
}
@Override
@@ -110,7 +110,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView
if (getContext() instanceof FragmentActivity) {
mLoaderManager = ((FragmentActivity) getContext()).getSupportLoaderManager();
- mLoaderManager.initLoader(hashCode(), null, this);
+ mLoaderManager.initLoader(0, null, this);
} else {
Log.e(Constants.TAG, "EncryptKeyCompletionView must be attached to a FragmentActivity, this is " + getContext().getClass());
}
@@ -136,7 +136,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView
where += " AND " + KeyRings.USER_ID + " LIKE ?";
return new CursorLoader(getContext(), baseUri, KeyAdapter.PROJECTION, where,
- new String[] { "%" + query + "%" }, null);
+ new String[]{"%" + query + "%"}, null);
}
mAdapter.setSearchQuery(null);
@@ -155,6 +155,14 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView
}
@Override
+ public void showDropDown() {
+ if (mAdapter == null || mAdapter.getCursor() == null || mAdapter.getCursor().isClosed()) {
+ return;
+ }
+ super.showDropDown();
+ }
+
+ @Override
public void onFocusChanged(boolean hasFocus, int direction, Rect previous) {
super.onFocusChanged(hasFocus, direction, previous);
if (hasFocus) {
@@ -171,7 +179,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView
}
Bundle args = new Bundle();
args.putString(ARG_QUERY, text.subSequence(start, end).toString());
- mLoaderManager.restartLoader(hashCode(), args, this);
+ mLoaderManager.restartLoader(0, args, this);
}
}