2

I'm trying to show a jquery mobile webpage on my webview, but I'm having problems with some events, for example: This is the test webpage that I'm trying to show :

http://jquerymobile.com/demos/1.0b2/docs/pages/multipage-template.html#one

When I use this :

webView.loadUrl("http://jquerymobile.com/demos/1.0b2/docs/pages/multipage-template.html#one");

I don't have any problem rendering the page also the events works fine, but I need to use loadDataWithBaseURL instead loadUrl on my application.

When I use this :

String htmlData = convertStreamToString(getAssets().open("page.txt"));
webView.loadDataWithBaseURL("http://jquerymobile.com/demos/1.0b2/docs/pages/multipage-template.html#one", htmlData, "text/html", "UTF-8", null);

Where page.txt is the source code of the page and htmlData the html code in String. It renders the page, click on Show page "two" works well also back to page one, but I have problem when I enter to Show page "popup" , the close button for the popup doesn't work neither Back to page "one" button in the dialog.

Anybody know what could be happen? Thanks!

2
  • Solved!, I added the historyUrl the same as the baseUrl and works! Commented Aug 11, 2011 at 14:38
  • So Please Answer it yourself and and mark it as accepted Commented Sep 14, 2011 at 8:59

1 Answer 1

1

Solved!, I added the historyUrl the same as the baseUrl and works!

final String baseURL = 
"http://jquerymobile.com/demos/1.0b2/docs/pages/multipage-template.html#one";

webView.loadDataWithBaseURL(baseURL, htmlData, "text/html", "UTF-8", baseURL);
Sign up to request clarification or add additional context in comments.

1 Comment

you must post code after you got the solution so that other people can also get to know :

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.