WebView mWebView=(WebView) findViewById(R.id.webView1);
mWebView.loadUrl("http://www.yuneach.com");在模拟器上,这个网页是在我自己的Activity上显示的,但是我把应用安装到手机上时,却弹出选择浏览器,然后是浏览器中显示了网页(脱离了我的Activity),请问这个怎么回事?
mWebView.loadUrl("http://www.yuneach.com");在模拟器上,这个网页是在我自己的Activity上显示的,但是我把应用安装到手机上时,却弹出选择浏览器,然后是浏览器中显示了网页(脱离了我的Activity),请问这个怎么回事?
解决方案 »
- 咨询Android代码运行机制
- 高手请入:android2.1 源码编译 及 SDK 修改
- 关于集合遍历 问题。。。
- 不想在桌面显示图标怎么办
- Android2.3的Launcher2源代码移到Eclipse里面去编译不能成功
- R cannot be resolved to a variable
- 希望高手推荐一个相对容易入门的android游戏引擎
- android 基站定位问题
- 【求助】关于自动执行按钮点击事件
- 不能使用listview控件 方法里 getView() 里面 View 缓存。。。
- android3.2 弹出dialog中edittext与软键盘
- 如果我想把tab放在左边,应该怎么实现?请各位大侠帮帮忙
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// get the view web intent
Intent intent = this.getViewWebIntent();
this.printInterestedActivitiesByIntent(intent);
// set the className to use the specific browser to open the webpage.
intent.setClassName("com.tencent.mtt", "com.tencent.mtt.MainActivity");
startActivity(intent);
}
/*
*get the desired view web intent
*/
private Intent getViewWebIntent() {
Intent viewWebIntent = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.parse("http://www.2cto.com");
viewWebIntent.setData(uri);
return viewWebIntent;
}
定 单 号:6795224
mWebView1.setWebViewClient(new WebViewClient()
{
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{ view.loadUrl(url); // 在当前的webview中跳转到新的url return true;
}
});
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView mWebView=(WebView) findViewById(R.id.webView1);
mWebView.setWebViewClient(new WebViewClient()
{
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{ view.loadUrl("http://localhost"); // 在当前的webview中跳转到新的url return true;
}
}); mWebView.loadUrl("http://localhost");
}