Android Display GIF Picture example detailed

Source: Internet
Author: User
Tags xmlns

android Display GIF Picture example detailed

Images in GIF format are not supported on Android, but because I want to be loaded in my program just when a villain is running indicates that it is loading. And this villain runs is a GIF picture. That is, you want the program to load a GIF image as soon as it starts. Look up some methods on the internet I don't know if the version of Android I use is high (android4.4) or what the problem is that it doesn't load. Finally thought of a way to load it out. The idea is to put the GIF in the WebView to show it.

Here's the code for this:

Activity_prepare_fullscreen.xml file

?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 <relativelayout xmlns:android=" http://schemas.android.co M/apk/res/android "xmlns:tools=" Http://schemas.android.com/tools "android:layout_width=" Match_parent "Android: layout_height= "Match_parent" android:background= "#F3F3F3" >   <webview android:id= "@+id/runwebview" Android:layout_width= "Wrap_content" android:layout_height= "Wrap_content" android:layout_centerhorizontal= "true" Android:layout_centervertical= "true"/>   <textview android:id= "@+id/fullscreen_content" Android:layout_ Width= "Wrap_content" android:layout_height= "wrap_content" android:layout_below= "@+id/runwebview" Android:layout_ Centerhorizontal= "true" android:gravity= "center" android:keepscreenon= "true" android:text= loading Please wait ... "Android: Textcolor= "#33b5e5" android:textsize= "30sp" android:textstyle= "bold"/>  ;/relativelayout>

Preparefullscreenactivity.java file

The extra is not posted, this is the main two sentences

Private WebView Runwebview=null;

Runwebview = (webview) Findviewbyid (R.id.runwebview);

The next sentence is to put the file, the file in the assents decentralized

Runwebview.loaddatawithbaseurl (NULL, "

"," text/html "," UTF-8 ", null);

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.