我正在通过Window进度条进行红色打击。我正在尝试将WEB转换为应用程序。
有关详细信息,请参见pic。
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);
}
}
});
}
}