webview.xml
WebViewActivity.java
public class WebViewActivity extends Activity {
private WebView webView;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.webview);
webView = (WebView) findViewById(R.id.webView1);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("http://maps.google.com/maps?" +"saddr=43.0054446,-87.9678884" + "&daddr=42.9257104,-88.0508355");
}
}
我想在WebView中打开以下代码:
final Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(
"http://maps.google.com/maps?" +
"saddr=43.0054446,-87.9678884" +
"&daddr=42.9257104,-88.0508355"));
intent.setClassName(
"com.google.android.apps.maps","com.google.android.maps.MapsActivity");
startActivity(intent);
我怎样才能做到这一点 ???
最佳答案