部分安卓设备openGallery回调FileSystemStorage.openInputStream报StackOverflowError
问题描述
- 复现范围:两周前开始,仅在部分安卓设备上复现
- 业务流程:调用
openGallery打开系统相册选取图片,在图片选中的回调中获取返回的图片路径后,调用Image.createImage加载所选图片。
核心代码如下:
Display.getInstance().openGallery(new ActionListener<ActionEvent>() { @Override public void actionPerformed(ActionEvent evt) { if (evt != null && evt.getSource() != null) { String imageFilePath = (String) evt.getSource(); Image.createImage(FileSystemStorage.getInstance().openInputStream(imageFilePath)); } } }, Display.GALLERY_IMAGE);
故障表现
- 触发节点:
FileSystemStorage.getInstance().openInputStream(imageFilePath)调用环节 - 异常类型:运行时抛出
java.lang.StackOverflowError: stack size … - 异常链路:应用先出现明显卡顿,持续一段时间后弹出上述错误。
内容的提问来源于stack exchange,提问作者Mahmoud Sabri
相关产品推荐
相关产品推荐

