Skip to content

Instantly share code, notes, and snippets.

Avatar

Johannes Borchardt jborchardt

View GitHub Profile
@jborchardt
jborchardt / android_gif
Created Oct 19, 2015
Simple Code for loading a Gif and setting its size in Android using a WebView (Android 2.2+).
View android_gif
final StringBuilder content = new StringBuilder();
content.append(
"<html><head><style>* {margin:0;padding:0;}</style></head><body>")
.append("<img src=\"" + imageUrl + "\" height=\"" + height
+ "\" width=\"" + width + "\"/>").append("</html></head>");
mWebView.loadDataWithBaseURL(null, content.toString(), "text/html", "UTF-8", null);