diff options
Diffstat (limited to 'OpenKeychain')
3 files changed, 9 insertions, 10 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java index 8c7606cf9..b00049ac7 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java @@ -73,7 +73,7 @@ public class EditKeyFragment extends LoaderFragment implements private View mAddKey; private static final int LOADER_ID_USER_IDS = 0; - private static final int LOADER_ID_KEYS = 1; + private static final int LOADER_ID_SUBKEYS = 1; private UserIdsAdapter mUserIdsAdapter; private SubkeysAdapter mSubkeysAdapter; @@ -202,7 +202,7 @@ public class EditKeyFragment extends LoaderFragment implements // Prepare the loaders. Either re-connect with an existing ones, // or start new ones. getLoaderManager().initLoader(LOADER_ID_USER_IDS, null, this); - getLoaderManager().initLoader(LOADER_ID_KEYS, null, this); + getLoaderManager().initLoader(LOADER_ID_SUBKEYS, null, this); } public Loader<Cursor> onCreateLoader(int id, Bundle args) { @@ -215,10 +215,10 @@ public class EditKeyFragment extends LoaderFragment implements UserIdsAdapter.USER_IDS_PROJECTION, null, null, null); } - case LOADER_ID_KEYS: { + case LOADER_ID_SUBKEYS: { Uri baseUri = KeychainContract.Keys.buildKeysUri(mDataUri); return new CursorLoader(getActivity(), baseUri, - SubkeysAdapter.KEYS_PROJECTION, null, null, null); + SubkeysAdapter.SUBKEYS_PROJECTION, null, null, null); } default: @@ -234,7 +234,7 @@ public class EditKeyFragment extends LoaderFragment implements mUserIdsAdapter.swapCursor(data); break; - case LOADER_ID_KEYS: + case LOADER_ID_SUBKEYS: mSubkeysAdapter.swapCursor(data); break; @@ -251,7 +251,7 @@ public class EditKeyFragment extends LoaderFragment implements case LOADER_ID_USER_IDS: mUserIdsAdapter.swapCursor(null); break; - case LOADER_ID_KEYS: + case LOADER_ID_SUBKEYS: mSubkeysAdapter.swapCursor(null); break; } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyKeysFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyKeysFragment.java index 4be572b4e..e46637871 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyKeysFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyKeysFragment.java @@ -87,7 +87,7 @@ public class ViewKeyKeysFragment extends LoaderFragment implements setContentShown(false); Uri baseUri = Keys.buildKeysUri(mDataUri); return new CursorLoader(getActivity(), baseUri, - SubkeysAdapter.KEYS_PROJECTION, null, null, null); + SubkeysAdapter.SUBKEYS_PROJECTION, null, null, null); } public void onLoadFinished(Loader<Cursor> loader, Cursor data) { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java index f5f4b32e6..02b1f31e2 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java @@ -42,7 +42,7 @@ public class SubkeysAdapter extends CursorAdapter { private ColorStateList mDefaultTextColor; - public static final String[] KEYS_PROJECTION = new String[]{ + public static final String[] SUBKEYS_PROJECTION = new String[]{ Keys._ID, Keys.KEY_ID, Keys.RANK, @@ -80,8 +80,7 @@ public class SubkeysAdapter extends CursorAdapter { @Override public Cursor swapCursor(Cursor newCursor) { hasAnySecret = false; - if (newCursor != null) { - newCursor.moveToFirst(); + if (newCursor != null && newCursor.moveToFirst()) { do { if (newCursor.getInt(INDEX_HAS_SECRET) != 0) { hasAnySecret = true; |