1. Download the #1 Android News App:   EarlyBird - News for Android
    Dismiss Notice

facing problem with webview. can any body help?

Last Updated:

  1. rafiqsab

    rafiqsab Member

    Developing a application on webview.

    have an fronthtml file which is emty and and have place holders for the contents. and have javascript function like bellow.

    // this is function from fronthtml page
    function adddata(dataHTML) {
    var newdataDiv = document.createElement("div");
    newdataDiv.innerHTML = dataHTML;

    var element = document.getElementById('outer');

    6.html has bellow div

    <meta http-equiv="content-type" content="text/html; charset=UTF-8"></head><body><div class="tile-group">
    <div style="width: 324px; background-color:LightGrey; height:186px; margin-left:0px; margin-right: 0px; float: left; margin-bottom: 0px; margin-top: 0px" class="tile" id="389">
    <a href="somelink" class="showlink">
    <div class="title">Digital Britain: Creative and Tech Talent Landscape</div>
    <div style="float: left; width: 315px; margin-left: 3px">
    <div style="float: left; width: 110px">
    <img src="6_files/5.png" alt="Digital india: " height="100" width="100">
    <div style="float: left; width: 200px;" class="type">
    <div style="float: left; height: 30px">
    <p>Blogs 7/12/2011</p></div>
    <div style="clear: both; float: left; height: 35px">
    <div style="clear: both; float: left; height: 40px">
    <div class="rating">
    * * * * * <span>(12 ratings)</span></div>
    <div class="description">
    <p>some text</p>

    i am using the bellow code to call the javascript function. passing 6.html link as input

    public class TestwebdemoActivity extends Activity {
    WebView mWebView;
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {

    mWebView = (WebView) findViewById(R.id.webView1);
    mWebView.setWebViewClient(new MyWebChromeClient());


    final class MyWebChromeClient extends WebViewClient {

    public void onPageFinished(WebView view, String url)



    above code is not working... is there any problem with passing parameters or javascript function?

    or can we pass link as input to the adddata javascript function?

    its very urgent for me please help me in this regards.

    thanks and regards


Share This Page