{"action":"opened","issue":{"url":"https://api.github.com/repos/lovetuzitong/MultiImageSelector/issues/5","labels_url":"https://api.github.com/repos/lovetuzitong/MultiImageSelector/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/lovetuzitong/MultiImageSelector/issues/5/comments","events_url":"https://api.github.com/repos/lovetuzitong/MultiImageSelector/issues/5/events","html_url":"https://github.com/lovetuzitong/MultiImageSelector/issues/5","id":70299680,"number":5,"title":"switch back to browse all will show camera grid no matter what","user":{"login":"liuxu0703","id":3444672,"avatar_url":"https://avatars.githubusercontent.com/u/3444672?v=3","gravatar_id":"","url":"https://api.github.com/users/liuxu0703","html_url":"https://github.com/liuxu0703","followers_url":"https://api.github.com/users/liuxu0703/followers","following_url":"https://api.github.com/users/liuxu0703/following{/other_user}","gists_url":"https://api.github.com/users/liuxu0703/gists{/gist_id}","starred_url":"https://api.github.com/users/liuxu0703/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liuxu0703/subscriptions","organizations_url":"https://api.github.com/users/liuxu0703/orgs","repos_url":"https://api.github.com/users/liuxu0703/repos","events_url":"https://api.github.com/users/liuxu0703/events{/privacy}","received_events_url":"https://api.github.com/users/liuxu0703/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-23T03:58:39Z","updated_at":"2015-04-23T03:58:39Z","closed_at":null,"body":"when switch to browse another folder, and then switch back to browse all images,\r\nthe camera grid will be shown regardless of whether the camera is requested.\r\n\r\nsolution is simple:\r\n\r\ndiff --git a/multi-image-selector/src/main/java/me/nereo/multi_image_selector/MultiImageSelectorFragment.java b/multi-image-selector/src/main/java/me/nereo/multi_image_selector/MultiImageSelectorFragment.java\r\nindex 01876c6..2d978d9 100644\r\n--- a/multi-image-selector/src/main/java/me/nereo/multi_image_selector/MultiImageSelectorFragment.java\r\n+++ b/multi-image-selector/src/main/java/me/nereo/multi_image_selector/MultiImageSelectorFragment.java\r\n@@ -94,6 +94,8 @@ public class MultiImageSelectorFragment extends Fragment {\r\n \r\n     private boolean hasFolderGened = false;\r\n \r\n+    private boolean mIsShowCamera;\r\n+\r\n     private File mTmpFile;\r\n \r\n     @Override\r\n@@ -130,13 +132,13 @@ public class MultiImageSelectorFragment extends Fragment {\r\n         }\r\n \r\n         // 是否显示照相机\r\n-        final boolean showCamera = getArguments().getBoolean(EXTRA_SHOW_CAMERA, true);\r\n-        mImageAdapter = new ImageGridAdapter(getActivity(), showCamera);\r\n+        mIsShowCamera = getArguments().getBoolean(EXTRA_SHOW_CAMERA, true);\r\n+        mImageAdapter = new ImageGridAdapter(getActivity(), mIsShowCamera);\r\n         // 是否显示选择指示器\r\n         mImageAdapter.showSelectIndicator(mode == MODE_MULTI);\r\n \r\n         // 如果显示了照相机，则创建临时文件\r\n-        if(showCamera){\r\n+        if(mIsShowCamera){\r\n             mTmpFile = FileUtils.createTmpFile(getActivity());\r\n         }\r\n \r\n@@ -271,7 +273,9 @@ public class MultiImageSelectorFragment extends Fragment {\r\n                 if (i == 0) {\r\n                     getActivity().getSupportLoaderManager().restartLoader(LOADER_ALL, null, mLoaderCallback);\r\n                     mCategoryText.setText(R.string.folder_all);\r\n-                    mImageAdapter.setShowCamera(true);\r\n+                    if (mIsShowCamera) {\r\n+                        mImageAdapter.setShowCamera(true);\r\n+                    }\r\n                 } else {\r\n                     Folder folder = (Folder) adapterView.getAdapter().getItem(i);\r\n                     if (null != folder) {\r\n\r\n\r\n@lovetuzitong wish you consider this~."}}