当前位置:操作系统 > 安卓/Android >>

Androdi网页记载进度条应用

package gongzibai.co.cc;

import android.Manifest.permission;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;
import android.webkit.WebChromeClient;
import android.webkit.WebView;

public class Webview1Activity extends
  Activity {

 private Handler handler = new Handler();
 private ProgressDialog progressDialog = null;

 /** Called when the activity is first created. */
 @Override
 public void onCreate(
   Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  setContentView(R.layout.main);

  final WebView webview = (WebView) findViewById(R.id.webView1);

  progressDialog = ProgressDialog
    .show(Webview1Activity.this,
      "请稍等...",
      "获取数据中...",
      true);

  new Handler().postDelayed(
    new Runnable() {

     @Override
     public void run() {
      // TODO Auto-generated method stub

      webview.loadUrl("www.zzzyk.com");
      progressDialog
        .dismiss();

     }
    }, 2000);

 }
 

 作者:gongzibai
 

补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,