We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1、通过其它应用隐式启动Activity访问BaiDu
//点击按钮后跳转,用浏览器打开链接 public void click(View v) { String url = "http://www.baidu.com"; // web address Intent intent = new Intent(Intent.ACTION_VIEW);//设置隐式启动activity intent.setData(Uri.parse(url)); startActivity(intent); }
public void click(View v){ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.baidu.com")); startActivity(intent); }
2、通过本应用隐式启动Activity访问BaiDu
private WebView myWebView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); myWebView = (WebView) findViewById(R.id.webView); myWebView.getSettings().setJavaScriptEnabled(true); myWebView.loadUrl("https://www.baidu.com"); }
<!--如果是本应用,需要在AndroidManifest.xml增加访问网络的权限--> <uses-permission android:name="android.permission.INTERNET"></uses-permission>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1、通过其它应用隐式启动Activity访问BaiDu
2、通过本应用隐式启动Activity访问BaiDu
The text was updated successfully, but these errors were encountered: