Using .gif file in android live wallpaper -


my question regarding post

is possible set animated gif file live wallpaper in android?

the method given in post not seem work. when put animated .gif file in /res/raw folder, there error says file cannot resolved or not field. there should know resources in raw folder or there other problem. following code.

belleengine() throws ioexception {

        inputstream = getresources().openrawresource(r.raw.ballerina);         if (is != null) {             try {                 mbelle = movie.decodestream(is);                 mbelleduration = mbelle.duration();             } {                 is.close();             }         } else {             throw new ioexception("unable open r.raw.belle");         } 

thanks in advance!

i have tried example works me. have tried different .gif images , doesn't seems problem. code . {

 /**      * method init suitable wallpaper according time.      */     private void initwallpaperaccordingtotime(inputstream inputstream) {          if (inputstream != null) {             try {                 wallpapergifstream = movie.decodestream(inputstream);                 if (wallpapergifstream != null) {                     duration = wallpapergifstream.duration();                 }             } catch (exception e) {                 e.printstacktrace();             } {                 try {                     inputstream.close();                 } catch (ioexception e) {                     e.printstacktrace();                 }             }         }      } 

call method follows.

 initwallpaperaccordingtotime(getresources().openrawresource(              r.raw.android_apple)); 

}


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -