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..
Don't turn off hardware acceleration for the whole application. That's crippling. Just turn it off for the view:
setLayerType(View.LAYER_TYPE_SOFTWARE, null);
Loading an animated GIF seems tricky, but I would suggest to use a WebView as an alternative.
Do as follow to resolve the problem :
I hope it helps !
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:
<activity
android:name=".MainActivity"
android:hardwareAccelerated="false"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>