# WebView Android Problem



## Rocky (15. Mai 2010)

Momentan hackt es bei einer ProgressBar/ProgressDialog, dass es nicht geladen/angezeigt wird...
Ich weiss nicht genau wie ich die einbauen kann/soll
Hier mal der zugehörige Code:


```
package de.web.eTCG;

import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.webkit.*;
import de.web.eTCG.R;
import android.app.ProgressDialog;

public class eTCG extends Activity {
private WebView view;

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

view = (WebView) findViewById(R.id.View);

view.getSettings().setJavaScriptEnabled(true);
view.setWebViewClient(new InsideWebViewClient());
view.loadUrl("http://www.etcg.de/");
}

private class InsideWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && view.canGoBack()) {
view.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
{
setProgressBarVisibility(true);
final Activity activity = this;
view.setWebViewClient(new WebViewClient() {
public void onProgressChanged(WebView view, int progress) {
activity.setProgress(progress * 100);
}
});
}
}
```


----------

