Web view in tabs

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

Web view in tabs

Postby gilvip » Mon Jan 25, 2010 2:52 pm

Hi all,

I'm trying to create a tabs view that each tab will show a different web site view.

The problem is that when I get redirecting link / press on a link inside the web content (in the tba), the web view is changing to full screen mode (and comes over the tabs.)

Can someone help me how to set the view to a fix size without taking controll over the whole screen ?

Thaks
Gil
gilvip
Freshman
Freshman
 
Posts: 2
Joined: Mon Jan 18, 2010 8:20 pm

Top

Solution found

Postby gilvip » Mon Jan 25, 2010 3:51 pm

Hi,

I found a sulotion here (but decided to keep this post for others):


http://code.google.com/p/android/issues/detail?id=812


public class BrowserDemo3 extends Activity {
WebView browser;

@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
browser=(WebView)findViewById(R.id.webkit);
browser.setWebViewClient(new Callback());

loadTime();
}

void loadTime() {
String page="<html><body><a href=\"clock\">"
+new Date().toString()
+"</a></body></html>";

browser.loadData(page, "text/html", "UTF-8");
}

private class Callback extends WebViewClient {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
loadTime();

// Gil: I used false here
return(true);
}
}
}
gilvip
Freshman
Freshman
 
Posts: 2
Joined: Mon Jan 18, 2010 8:20 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 6 guests