mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 11:12:15 -05:00
prevent crashes in EncryptKeyCompletionView
This commit is contained in:
parent
4ba2e4bcdd
commit
91b774d223
@ -110,7 +110,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView
|
|||||||
|
|
||||||
if (getContext() instanceof FragmentActivity) {
|
if (getContext() instanceof FragmentActivity) {
|
||||||
mLoaderManager = ((FragmentActivity) getContext()).getSupportLoaderManager();
|
mLoaderManager = ((FragmentActivity) getContext()).getSupportLoaderManager();
|
||||||
mLoaderManager.initLoader(hashCode(), null, this);
|
mLoaderManager.initLoader(0, null, this);
|
||||||
} else {
|
} else {
|
||||||
Log.e(Constants.TAG, "EncryptKeyCompletionView must be attached to a FragmentActivity, this is " + getContext().getClass());
|
Log.e(Constants.TAG, "EncryptKeyCompletionView must be attached to a FragmentActivity, this is " + getContext().getClass());
|
||||||
}
|
}
|
||||||
@ -154,6 +154,14 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView
|
|||||||
mAdapter.swapCursor(null);
|
mAdapter.swapCursor(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showDropDown() {
|
||||||
|
if (mAdapter.getCursor().isClosed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.showDropDown();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFocusChanged(boolean hasFocus, int direction, Rect previous) {
|
public void onFocusChanged(boolean hasFocus, int direction, Rect previous) {
|
||||||
super.onFocusChanged(hasFocus, direction, previous);
|
super.onFocusChanged(hasFocus, direction, previous);
|
||||||
@ -171,7 +179,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView
|
|||||||
}
|
}
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putString(ARG_QUERY, text.subSequence(start, end).toString());
|
args.putString(ARG_QUERY, text.subSequence(start, end).toString());
|
||||||
mLoaderManager.restartLoader(hashCode(), args, this);
|
mLoaderManager.restartLoader(0, args, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user