GIF File InputStream
<p>I want to get a gif file input stream. Like when we use getAssert().open(file) to get input stream. But unfortunately this method only can use in activity. How can I do it?</p>

<p>This is my code:</p>

<pre><code>protected void onDraw(Canvas canvas) {
    InputStream inputStream = null;
    try {
        inputStream= new FileInputStream(new File("/media/VJ/rainbow/troll_messenger/troll_messenger-0.1/app/assets/loading.gif"));
    } catch(IOException e) {
        e.printStackTrace();
    }
    movie = Movie.decodeStream(inputStream);
    canvas.drawColor(Color.WHITE);
    super.onDraw(canvas);
    final long now = SystemClock.uptimeMillis();
    if(movieStart == 0)
        movieStart = now;
    final int relTime = (int)((now - movieStart) % movie.duration());
    movie.setTime(relTime);
    movie.draw(canvas, 0, 0);
    this.invalidate();
}
</code></pre>
