PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, July 17, 2022

[FIXED] How to get gif image from a link in android-gif-drawable? [Android]

 July 17, 2022     android, gif, image     No comments   

Issue

I'm using this library to display my gif files. When my gif files are saved in my device storage it displays the gif file okay, by using

GifDrawable gifFromPath;
File gifFile;


GifImageView gifImageView = (GifImageView) findViewById(R.id.imageHome);

gifFile = new File(context.getFilesDir().getAbsolutePath(), imageName);
try {
                gifFromPath = new GifDrawable(gifFile);
            } catch (IOException e) {
                e.printStackTrace();
            }
gifImageView.setImageDrawable(gifFromPath);

I'm wondering how can I display the gif file if instead of using the path where it is saved I want to get the gif from a link / url.


Solution

I use this library. And I use ImageView instead.

ImageView myImageView = (ImageView) findViewById(R.id.myImageView);

Glide.with(this).load(url).into(myImageView);


Answered By - natsumiyu
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing