High-Priced Help
"customHelp");
browser.loadUrl("file:///android_asset/help.html");
Button cast=(Button)findViewById(R.id.helpcast);
cast.setOnClickListener(onCast);
}
In particular, we need to enable Javascript in the WebView and inject our
CustomHelp object (under the name customHelp) before we load our help Web
page.
Step #4: Leverage the Java Object from Javascript
With all that done, we can take advantage of the customHelp object in our
Web page.
Somewhere on your page, add a
"customHelp");
browser.loadUrl("file:///android_asset/help.html");
Button cast=(Button)findViewById(R.id.helpcast);
cast.setOnClickListener(onCast);
}
In particular, we need to enable Javascript in the WebView and inject our
CustomHelp object (under the name customHelp) before we load our help Web
page.
Step #4: Leverage the Java Object from Javascript
With all that done, we can take advantage of the customHelp object in our
Web page.
Somewhere on your page, add a
or with an id of userName, such
as:
Then, add a global Javascript function that will replace the default contents
of the userName element with the value obtained from customHelp, such as:
Finally, add an onLoad attribute to your element to trigger calling the
global Javascript function, such as:
259
Subscribe to updates at http://commonsware.com
Special Creative Commons BY-NC-SA 3.0 License Edition
as:
Your Twitter account name is:
unknown!
Then, add a global Javascript function that will replace the default contents
of the userName element with the value obtained from customHelp, such as:
Finally, add an onLoad attribute to your element to trigger calling the
global Javascript function, such as:
259
Subscribe to updates at http://commonsware.com
Special Creative Commons BY-NC-SA 3.0 License Edition
