在Eclipse android中获得关于windown.feature_progress的攻击

时间:2016-07-19 19:36:02

标签: java android eclipse progress-bar android-progressbar

我正在通过Window进度条进行红色打击。我正在尝试将WEB转换为应用程序。

有关详细信息,请参见pic。

enter image description here

    final Activity mActivity = this;
    super.onCreate(savedInstanceState);

    // Adds Progrss bar Support
    this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
    setContentView(R.layout.portal);


    // Makes Progress bar Visible
    getWindow().setFeatureInt( Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);

    mWebView = (WebView) findViewById( R.id.webView1 );
    mWebView.getSettings().setJavaScriptEnabled(true);     
    mWebView.loadUrl("https://cms.comsats.edu.pk:8092");


    mWebView.setWebChromeClient(new WebChromeClient() 
    {
        public void onProgressChanged(WebView view, int progress)  
        {
            //Make the bar disappear after URL is loaded, and changes string to Loading...
            mActivity .setTitle("Loading...");
            mActivity .setProgress(progress * 100); //Make the bar disappear after URL is loaded

            // Return the app name after finish loading
            if(progress == 100)
            {
                financialPortalActivity.setTitle(R.string.yourWebSiteName);
            }
        }
    });
}
}

0 个答案:

没有答案