android resultCode 一直为0问题解决
16lz
2021-01-24
郁闷! 想要获取本地图片,intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(intent,1); 能过 这个来做,在 onActivityResult 中接收,但每次只要一点按钮,还没跳到图库,onActivityResult 就触发了,并且resultCode 一直为0 。
原因: Activity 设成了singleInstance,去掉就好了
更多相关文章
- Android自学之路,DrawerLayout must be measured with MeasureSpe
- Android(安卓)代码中动态为RadioGroup添加RadioButton
- Android(安卓)Dialog的四种情况
- Ubuntu14.04 ERROR WHILE LOADING SHARED LIBRARIES: LIBSTDC++.
- android日常问题及解决方案
- NDK编译:fatal error: GLES2/gl2platform.h: No such file or dir
- android各种组件的监听器
- ViewGroup为什么不会调用onDraw
- 捕获android中的Home key