如果有人能帮助我,我将非常高兴.我有一个使用webview的应用程序.webview加载了一个网址,我使用Google教程覆盖了我想用webview打开的所有其他链接.我已经创建了一个animimation文件,res/并且slide_right xml到目前为止一直很好.我在主java活动中调用了效果,但它仅适用于第一页.我想要的是在webview中链接加载的每个页面中应用的效果.
你能用我的代码帮助我吗?
package com.ihome;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class IhomeActivity extends Activity {
WebView mWebView;
private class HelloWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Animation slideRightAnimation = AnimationUtils.loadAnimation(getBaseContext (), R.anim.slide_right);
mWebView.startAnimation(slideRightAnimation);
view.loadUrl(url);
return true;
}
}
@Override
public boolean onKeyDown(int keyCode, …Run Code Online (Sandbox Code Playgroud)