Webview过渡到下一页

时间:2013-03-01 00:28:09

标签: android webview

嘿伙计们,我想知道是否有可能让webview保持在webview中,而不是在页面上点击链接时进入浏览器。

    package com.example.athletic_profile;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        WebView wv = (WebView) findViewById(R.id.webView);

        WebSettings webSettings = wv.getSettings();
        webSettings.setBuiltInZoomControls(true);


        wv.loadUrl("http://www.yahoo.com");
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

}

0 个答案:

没有答案