@Override
@SuppressLint("SetJavaScriptEnabled")
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web);
WebView webView = (WebView) findViewById(R.id.web_view);
String url = getIntent().getStringExtra(URL);
if (url == null && getIntent().getData() != null) {
url = getIntent().getData().getQueryParameter(URL);
}
if (url == null) {
finish();
}
webView.setWebViewClient(new InnerWebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(url);
loading = (TextView) findViewById(R.id.loading);
Animation animation = new ScaleAnimation(1.0f, 1.2f, 1.0f, 1.2f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
animation.setRepeatMode(Animation.REVERSE);
animation.setRepeatCount(Animation.INFINITE);
animation.setDuration(500);
loading.startAnimation(animation);
setTitle(url);
}
WebActivity.java 文件源码
java
阅读 42
收藏 0
点赞 0
评论 0
项目:Floo
作者:
评论列表
文章目录