我想从内部存储器读取.gif文件。我可以读取图像,mp3,但不能读取.gif。实际上,我正在搜索全局的方式来读取任何类型的文件。
问候
编辑:
private void globalGif() throws FileNotFoundException{
FileInputStream fis = openFileInput("frog");
GifMovieView gmv = new GifMovieView(getApplicationContext(), fis);
setContentView(gmv);
}我使用了这段代码,但它显示了这个错误。divide by zero fis没有gif文件。
发布于 2013-06-11 15:14:06
你可以通过以下方式找到图片的路径
File file= new File(Environment.getExternalStorageDirectory()
+ "/Images/a.gif");
But you can not set this gif image to ImageView the gif file is show in webView.发布于 2013-06-11 15:15:01
如果你想阅读gif文件,可以看看Movie class。
这是一个nice tutorial,它向你展示了如何加载和显示一个gif。
https://stackoverflow.com/questions/17038360
复制相似问题