splash screen for webview

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

splash screen for webview

Postby rdormer » Fri Dec 19, 2008 8:02 pm

Is there a way to have a splash screen display until a WebView object is done loading a web page? As far as I can tell, loadUrl is a non-blocking call, so that after calling it the web page may not be done loading for a while.

I've tried looping on the getProgress method, but it doesn't seem to work - I never see my splash screen come up, despite the call to setContentView for the splash screen being the first line in my activity's onCreate method.

super.onCreate(savedInstanceState);
setContentView(R.layout.splash);


SAWebView browser = new SAWebView(this);

browser.loadUrl(urlString);
browser.clearCache(true);
setContentView(browser);


But even if I put a loop in between the call to clearCache and the second call to setContentView, it seems to just skip straight to the web view - which then remains blank while the page is loading.
rdormer
Freshman
Freshman
 
Posts: 8
Joined: Tue Dec 16, 2008 12:26 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 7 guests