'Now I am developing application in Phonegap framework.My question i开发者_如何学编程s animated images are displaying but there is no animation. In browser it is working fine.In emulator only displaying image. How can I fix this issue?
 private static class GIFView extends View{        
            Movie movie;  
            InputStream is=null;  
            long moviestart;  
            public GIFView(Context context) 
            {  
                super(context);  
                is=context.getResources().openRawResource(R.drawable.smile);  
                movie=Movie.decodeStream(is);                 
            }  
            @Override  
            protected void onDraw(Canvas canvas) 
            {  
                super.onDraw(canvas);  
                long now=android.os.SystemClock.uptimeMillis();  
                 if (moviestart == 0) {   // first time  
                     moviestart = now;  
                 }            
                   int relTime = (int)((now - moviestart) % movie.duration()) ;                 
                     movie.setTime(relTime);
                     movie.draw(canvas,100,100); 
                     this.invalidate();  
            }                         
        }    
use this class and add the view to your layout,
 GIFView view=new GIFView(this);
            linear=(LinearLayout)findViewById(R.id.linear);
            linear.addView(view);
it may helps you..
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论