encryptkeycompletionview: don't initialize to null on attach
This commit is contained in:
@@ -91,16 +91,16 @@ public class EncryptModeAsymmetricFragment extends EncryptModeFragment {
|
||||
});
|
||||
|
||||
final ViewAnimator vEncryptionIcon = (ViewAnimator) view.findViewById(R.id.result_encryption_icon);
|
||||
mEncryptKeyView.setTokenListener(new TokenListener() {
|
||||
mEncryptKeyView.setTokenListener(new TokenListener<KeyItem>() {
|
||||
@Override
|
||||
public void onTokenAdded(Object o) {
|
||||
public void onTokenAdded(KeyItem o) {
|
||||
if (vEncryptionIcon.getDisplayedChild() != 1) {
|
||||
vEncryptionIcon.setDisplayedChild(1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTokenRemoved(Object o) {
|
||||
public void onTokenRemoved(KeyItem o) {
|
||||
int child = mEncryptKeyView.getObjects().isEmpty() ? 0 : 1;
|
||||
if (vEncryptionIcon.getDisplayedChild() != child) {
|
||||
vEncryptionIcon.setDisplayedChild(child);
|
||||
|
||||
@@ -110,7 +110,6 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView<KeyItem>
|
||||
|
||||
if (getContext() instanceof FragmentActivity) {
|
||||
mLoaderManager = ((FragmentActivity) getContext()).getSupportLoaderManager();
|
||||
mLoaderManager.initLoader(0, null, this);
|
||||
} else {
|
||||
Log.e(Constants.TAG, "EncryptKeyCompletionView must be attached to a FragmentActivity, this is " + getContext().getClass());
|
||||
}
|
||||
@@ -135,12 +134,6 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView<KeyItem>
|
||||
+ KeyRings.IS_EXPIRED + " = 0 AND "
|
||||
+ Tables.KEYS + "." + KeyRings.IS_REVOKED + " = 0";
|
||||
|
||||
if (args == null || !args.containsKey(ARG_QUERY)) {
|
||||
// mAdapter.setSearchQuery(null);
|
||||
// return new CursorLoader(getContext(), baseUri, projection, where, null, null);
|
||||
return null;
|
||||
}
|
||||
|
||||
String query = args.getString(ARG_QUERY);
|
||||
mAdapter.setSearchQuery(query);
|
||||
|
||||
@@ -169,8 +162,6 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView<KeyItem>
|
||||
super.showDropDown();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onFocusChanged(boolean hasFocus, int direction, Rect previous) {
|
||||
super.onFocusChanged(hasFocus, direction, previous);
|
||||
|
||||
Reference in New Issue
Block a user