Open zjackcoder opened 8 years ago
你的手机是不是自动旋转开了。 你如果着急用的话,可以吧代码下载下来,在manifest里面指定activity 的横竖屏幕,我回头去修复这个bug
那个是强制横屏的 就算在manifest 里面配置还是会被横竖屏幕切换,简单使用savedInstanceState保存currentfile 也没什么用,activity 重启了两次 导致MediaScannerConnection还没扫描完activity 就关闭了,,服务泄漏了
`3-17 15:01:47.133 9994-9994/com.eq.gallery I/gallery: onCreate~~~~
03-17 15:01:47.163 9994-9994/com.eq.gallery I/gallery: /storage/emulated/0/DCIM/IMG_20160317150130.jpg
03-17 15:01:47.253 9994-11290/com.eq.gallery E/TAG: 71
03-17 15:01:47.283 9994-11295/com.eq.gallery E/TAG: 71
03-17 15:01:48.163 9994-9994/com.eq.gallery I/Choreographer: Skipped 63 frames! The application may be doing too much work on its main thread.
03-17 15:01:48.243 9994-9994/com.eq.gallery I/gallery: onSaveInstanceState~~
03-17 15:01:48.273 9994-9994/com.eq.gallery I/gallery: onCreate~~~~
03-17 15:01:48.303 9994-9994/com.eq.gallery I/gallery: /storage/emulated/0/DCIM/IMG_20160317150130.jpg
03-17 15:01:48.323 9994-11317/com.eq.gallery E/TAG: 72
03-17 15:01:48.333 9994-11318/com.eq.gallery E/TAG: 73
03-17 15:01:48.363 9994-11319/com.eq.gallery E/TAG: 73
03-17 15:01:48.433 9994-9994/com.eq.gallery E/ViewRootImpl: sendUserActionEvent() mView == null
03-17 15:01:48.433 9994-9994/com.eq.gallery E/ViewRootImpl: sendUserActionEvent() mView == null
03-17 15:01:48.443 9994-9994/com.eq.gallery E/ActivityThread: Activity com.wq.photo.MediaChoseActivity has leaked ServiceConnection android.media.MediaScannerConnection@32af392c that was originally bound here
android.app.ServiceConnectionLeaked: Activity com.wq.photo.MediaChoseActivity has leaked ServiceConnection android.media.MediaScannerConnection@32af392c that was originally bound here
at android.app.LoadedApk$ServiceDispatcher.
你的手机是4.几的系统?我的s6是没有这个问题的
手机 android 5.0
我已经解决了那个问题,发布了3.1.0 你改一下版本号 应该就ok了!谢谢你的反馈
compile 'com.github.wqandroid:wqgallery:3.1.0'
谢谢,,可以用了
再改一下就完美了
在PhotoGalleryFragment,159行改成
handler.post(new Runnable() { @Override public void run() { currentimageses.add(0, path); imageses.add(0, path); adapter.notifyDataSetChanged(); } });
在PhotoAdapter 类的getitem方法改成下面:
public String getItem(int postion) { int realPos = postion; if (isNeedCamera){ realPos = postion -1; } if (realPos >= imageses.size()) return ""; return imageses.get(realPos); }
已采纳谢谢
该三星手机在照相机启动时候 会导致 app 被强制横屏导致 activity 里面的一些变量为空...