1: After checking the data, there are two kinds of GIF animations loaded in Android
1) Use Webview,webview to invoke the main three methods: Loadurl, LoadData, Loaddatawithbaseurl
2) The main use is: Android Android.graphics.Movie this class, which is provided by Android to us a very convenient tool. Some notes such as API one Android 3.0 honeycomb (APILevel 11) cannot be used after hardware rendering.
/*** starting from Honeycomb has to turn off HW acceleration to draw* Movie on Canvas. * /if (Build.VERSION.SDK_INT >= build.version_codes. Honeycomb) { setlayertype (view.layer_type_software, null); }
You need to turn off hardware rendering for the view component. Refer to the following:
public class Fragmentcomment extends Fragment {private View rootview; @Overridepublic View Oncreateview (layoutinflater Inflater, ViewGroup container,bundle savedinstancestate) {//TODO auto-generated Method Stubrootview = Inflater.inflate ( R.layout.case_history_comment, NULL); Rootview.setlayertype (view.layer_type_software, null); return rootview;}}
Reference: HTTP://MY.OSCHINA.NET/U/143926/BLOG/173011?FROMERR=4FLMA5Q5
Finally see the summary of http://weavora.com/blog/2012/02/07/android-and-how-to-use-animated-gifs/this article.
March 1, 2016 Android notes