Show .gif with android.graphics.Movie

前端 未结 3 1459
夕颜
夕颜 2021-02-01 06:46

I\'m trying, create a view with an animated GIF..

When i try run the follow code in emulator all works fine. But when i try run in real Smart Phone, nothing happens..

3条回答
  •  终归单人心
    2021-02-01 07:23

    I dont think the Movie object works correctly on devices where hardware acceleration is turned on (which is turned on by default in Android 4.x for devices that support it. Your emulator may not.)

    Try adding

     android:hardwareAccelerated="false"
    

    to the activity definition for MainActivity in AndroidManifest.xml

    Example:

    
        
            
    
            
        
    
    

提交回复
热议问题