I am trying to use a progress dialog while my webview is loading and I want it to disappear when the webpage is done loading. It is a tricky situation since I have 3 tabs all with webviews in them and it is one activity. Can someone help me with my code:
if("TAB_2".equals(tabId)) {
ProgressDialog pd = ProgressDialog.show(mainmenu.this, "", "Loading. Please wait...", true);
int progress1 = 1;
while(progress1 < 100) {progress1 = webview2.getProgress();}
if(progress1 > 99) {pd.dismiss();}
}
What am I doing wrong here?
Nick… Hmmm. I see that your task may involve updating the UI. You can attach a handler to your activity and loop every second checking the UI to see if it is done updating. When it is done you can dismiss the progressdialog.