当我尝试在Android 2.3.3 API 10中使用WebView读取gif图像时,它不是动画的(它看起来是静态的).我该如何解决这个问题?有什么设置我必须改变吗?
ActivtiyMain.xml:
<WebView
android:id="@+id/webView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/textView1"
android:layout_marginTop="14dp"
/>
Run Code Online (Sandbox Code Playgroud)
MainActivity.java:
public WebView Wv;
Wv = (WebView) findViewById(R.id.webView1);
Wv.loadUrl("file:///android_asset/bet.gif");
Run Code Online (Sandbox Code Playgroud)
bet.gif:添加到资产文件夹的gif图像.
我需要调试我的应用程序,并调试runnable内的代码,并在应用程序中执行一些操作然后再次调试代码,但我不能这样做,我不能做任何操作,调试点立即激活.
代码:
public class UpdateHandler {
public static Handler getHandler() {
if (sHandler == null) {
HandlerThread looper = new HandlerThread("update Handler");
looper.start();
sHandler = new Handler(looper.getLooper());
}
return sHandler;
}
}
UpdateHandler.getHandler().post(new Runnable() {
@Override
public void run() {
update();
}
});
public void update() {
// i put the debug point here .
}
Run Code Online (Sandbox Code Playgroud)