开发中所遇到的一些问题与解决方法(2)
2015-04-02 16:07
555 查看
2.开发中,new GZIPInputStream(urlConnection.getInputStream())
这行代码抛了IOException.在网上看到的一个解决方法(http://stackoverflow.com/questions/5131016/gzipinputstream-fails-with-ioexception-in-android-2-3-but-works-fine-in-all-pre):
InputStream in = url.openStream();
GZIPInputStream zin;
try {2.3以后
zin = (GZIPInputStream)in;
} catch (Exception e) {//2.3以前
zin = new GZIPInputStream(in);
}
解释是: It looks like Gingerbread (2.3) changed the way GZipped streams are handled. Looking at the "magic block" characters indicates that openStream() automatically detects GZipped data and runs it through the correct stream decoder. Of course, if you attempt
to run another GZIP decoder on the same stream, that will fail with an IOException.
1.SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
在edittext上输入几个字母,将光标移到前面,再将光标移到后面,就报了这个错误。后来在stactoverflow上找到了解决方法。将edittext的inputType属性值修改为 android:inputType="textNoSuggestions",就解决了。
这行代码抛了IOException.在网上看到的一个解决方法(http://stackoverflow.com/questions/5131016/gzipinputstream-fails-with-ioexception-in-android-2-3-but-works-fine-in-all-pre):
InputStream in = url.openStream();
GZIPInputStream zin;
try {2.3以后
zin = (GZIPInputStream)in;
} catch (Exception e) {//2.3以前
zin = new GZIPInputStream(in);
}
解释是: It looks like Gingerbread (2.3) changed the way GZipped streams are handled. Looking at the "magic block" characters indicates that openStream() automatically detects GZipped data and runs it through the correct stream decoder. Of course, if you attempt
to run another GZIP decoder on the same stream, that will fail with an IOException.
1.SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
在edittext上输入几个字母,将光标移到前面,再将光标移到后面,就报了这个错误。后来在stactoverflow上找到了解决方法。将edittext的inputType属性值修改为 android:inputType="textNoSuggestions",就解决了。
相关文章推荐
- 最近在ArcGIS Engine开发中关于调用gp工具过程出现COM 组件的调用返回了错误 HRESULT E_FAIL 错误的解决方法 和 学习oracle中遇到的一些问题总结
- Oracle BPM开发中遇到的一些问题和解决方法
- cgi开发中遇到的一些问题及解决方法
- lucene在实际项目开发中遇到的一些问题及解决方法
- CUnit开发环境搭建过程可能遇到的一些问题及解决方法
- 配置开发环境遇到的一些问题及解决方法
- Cocos2DX开发:记录遇到的一些问题和解决方法
- 嵌入式linux(内核为linux 2.6.30.4)开发中遇到的一些问题解决方法
- 最近在用mvc3开发时遇到的一些小问题与解决方法....
- 最近在用mvc3开发时遇到的一些小问题与解决方法....
- 开发中所遇到的一些问题与解决方法(1)
- 前端webview开发中遇到的一些问题及其解决方法
- Oracle BPM开发中遇到的一些问题和解决方法
- J2ME使用WTK模拟器开发时候遇到“OK to use Airtime” 问题的解决方法
- 使用VIM开发软件项目 - (16) vim编译中遇到的问题及解决方法
- Web Part 开发中遇到的问题及解决方法
- powerDesigner遇到的一些问题解决方法
- 搭建WinXP+VS2008+IIS+Sql Server 2005开发环境遇到的问题及解决方法备案
- asp.net开发与web标准的冲突问题的一些常见解决方法