1

I want to read .gif file from internal storage. I can read image, mp3 but not .gif. Actually I am searching global way to read any types of file.

Regards

Edit:

private void globalGif() throws FileNotFoundException{
    FileInputStream fis = openFileInput("frog");
    GifMovieView gmv = new GifMovieView(getApplicationContext(), fis);
    setContentView(gmv);
}

I use this code but it shows this error. divide by zero fis haven't gif file.

4

2 回答 2

1

您可以通过以下方式找到图像的路径

 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-11T07:14:06.007 回答
1

如果您想阅读 gif 文件,请查看Movie class.

这是一个很好的教程,向您展示如何加载 gif 并显示它。

于 2013-06-11T07:15:00.660 回答