webview에서 활동 표시기를 나타내는 코드가 있습니다. 하나 이상의 참조를 확인했지만 여전히 작동하지 못했습니다. 아래 코드를 디버깅하도록 도와 주시겠습니까?android webview client activity indicator
활동 표시등이 활동의 onCreate
방법에 아래의 코드와 코드 아래
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
final BaseActivity MyActivity = ReviewWebActivity.this;
setContentView(R.layout.review_web);
getWindow().setFeatureInt(Window.FEATURE_PROGRESS,
Window.PROGRESS_VISIBILITY_ON);
ScannedProduct product = getReviewUrl();
reviewUrl = product.getReviewLink();
if (reviewUrl == null) {
String err = product.getErrorCode();
if(err.equals("")) err ="No Data Available for this product";
Toast.makeText(getApplicationContext(),
"No Data Available for this product", 1).show();
return;
}
webReview = (WebView) findViewById(R.id.webReview);
webReview.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
// Make the bar disappear after URL is loaded, and changes
// string to Loading...
MyActivity.setTitle("Loading...");
MyActivity.setProgress(progress * 1000); // tried with 100 also
}
});
webReview.setWebViewClient(new ReviewWebClient());
webReview.getSettings().setJavaScriptEnabled(true);
webReview.loadUrl(reviewUrl);
}
감사합니다. – png
ChromeClient 클래스에는 진행률 개체가 없습니다. – Rajan