ghostCoder
ghostCoder

Reputation: 7655

phonegap android: opening another html file in the phonegap webview

i am building a phonegap(v1.3) android(for 3.1 sdk) app. i load the index.html page as in the sample app

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.setIntegerProperty("loadUrlTimeoutValue", 60000);
    super.loadUrl("file:///android_asset/www/index.html"); 
}

this works fine. now later on i want to load another abc.html file in the webview when i call for it from the js through a plugin. How to achieve a function like this which we can call from a Phonegap plugin.

public void loadUrl(String file){
     super.setIntegerProperty("loadUrlTimeoutValue", 60000);
     super.loadUrl("file:///android_asset/www/"+file+".html");   
}

Or if not this way, how to load another html in the phonegap webview?

Upvotes: 3

Views: 6797

Answers (1)

ghostCoder
ghostCoder

Reputation: 7655

a simple

window.location.href = "file.html";

was the way. :(

Upvotes: 4

Related Questions