WebView addJavascriptInterface function with Parameters
<p>I have added a JavaScript Interface to WebView.</p>

<p>I am able to use all the Functions which has no Parameters. </p>

<p>But When i gave the Parameter from JavaScript. The function are not called by WebView.</p>

<p>See Code</p>

<p>Javascript</p>

<pre><code>        function getCellString(row, column) {
            return Report.getCellString(row,column);
        }
</code></pre>

<p>WebView</p>

<pre><code>webView.addJavascriptInterface(new JavaScriptInterface(), "Report");
</code></pre>

<p>Javascript Interface</p>

<pre><code>public class JavaScriptInterface
{
public String getCellString(int row, int column)
{
    return row + "," + column;
}
}
</code></pre>

<p>I am not sure whether it because String return type or the parameter for the function.</p>

<p><strong>EDITED</strong></p>

<p>I tried giving no Parameters to the getCellString() Still it is not being called.</p>

<p>That means problem is with return type. I gave the String return type which is not primitive data type.</p>

<p>Can any one tell me what Data Type should i give in place of String so that it accepts.</p>

<p>LogCat after addJavaScriptInterface</p>

<pre><code>   03-17 17:52:26.748: V/webcore(19908): ADD_JS_INTERFACE arg1=0 arg2=0 obj=android.webkit.WebViewCore$JSInterfaceData@44dfe378
03-17 17:52:26.858: V/webcore(19908): LOAD_URL arg1=0 arg2=0 obj=android.webkit.WebViewCore$GetUrlData@44dff760
03-17 17:52:26.858: V/webcore(19908):  CORE loadUrl file:///data/data/mypackage/cache/html_report/ReportHTML.html
03-17 17:52:26.858: V/webkit(19908): startLoadingResource: url=file:///data/data/mypackage/cache/html_report/ReportHTML.html, method=GET, postData=null, isMainFramePage=true, mainResource=true, userGesture=true
03-17 17:52:26.858: V/webkit(19908): LoadListener constructor url=file:///data/data/mypackage/cache/html_report/ReportHTML.html
03-17 17:52:26.868: V/webview(19908): WEBCORE_INITIALIZED_MSG_ID
03-17 17:52:26.868: V/webkit(19908): LoadListener: from: file:///data/data/mypackage/cache/html_report/ReportHTML.html major: 1 minor: 1 code: 200 reason: OK
03-17 17:52:26.878: V/webkit(19908): LoadListener.headers
03-17 17:52:26.878: V/webcore(19908): 200 arg1=0 arg2=0 obj=null
03-17 17:52:26.878: V/webkit(19908): LoadListener.data(): url: file:///data/data/mypackage/cache/html_report/ReportHTML.html
03-17 17:52:26.878: V/webkit(19908): LoadListener.data(): url: file:///data/data/mypackage/cache/html_report/ReportHTML.html
03-17 17:52:26.888: V/webkit(19908): LoadListener.endData(): url: file:///data/data/mypackage/cache/html_report/ReportHTML.html
03-17 17:52:26.898: V/webkit(19908): guessMimeTypeFromExtension: url = file:///data/data/mypackage/cache/html_report/ReportHTML.html
03-17 17:52:26.908: V/webview(19908): sendOurVisibleRect=(0,55,r=240,b=320
03-17 17:52:26.908: V/webview(19908): setCertificate=null
03-17 17:52:26.988: V/webkit(19908): LoadListener.detachRequestHandle(): requestHandle: null
03-17 17:52:27.098: V/webview(19908): SET_SCROLLBAR_MODES
03-17 17:52:27.098: V/webview(19908): SET_SCROLLBAR_MODES
03-17 17:52:27.098: V/webview(19908): SET_SCROLLBAR_MODES
03-17 17:52:27.098: V/webcore(19908): didFirstLayout standardLoad =true
03-17 17:52:27.108: V/webcore(19908): SET_SCROLL_OFFSET arg1=0 arg2=0 obj=Point(0, 0)
03-17 17:52:27.108: V/webview(19908): UPDATE_TEXT_ENTRY_MSG_ID
03-17 17:52:27.108: V/webcore(19908): SET_GLOBAL_BOUNDS arg1=0 arg2=0 obj=Rect(0, 55 - 240, 320)
03-17 17:52:27.118: V/webcore(19908): VIEW_SIZE_CHANGED arg1=0 arg2=0 obj=android.webkit.WebView$ViewSizeData@44d1d2c8
03-17 17:52:27.118: V/webcore(19908): viewSizeChanged w=313; h=353; textwrapWidth=313; scale=0.75
03-17 17:52:27.118: V/webcore(19908): viewSizeChanged
03-17 17:52:27.118: V/webcore(19908): SET_ACTIVE arg1=0 arg2=0 obj=null
03-17 17:52:27.128: V/webcore(19908): WEBKIT_DRAW arg1=0 arg2=0 obj=null
03-17 17:52:27.128: V/webcore(19908): webkitDraw start
03-17 17:52:27.128: V/webcore(19908): webkitDraw NEW_PICTURE_MSG_ID
03-17 17:52:27.128: V/webcore(19908): UPDATE_CACHE_AND_TEXT_ENTRY arg1=0 arg2=0 obj=null
03-17 17:52:27.128: V/webview(19908): NEW_PICTURE_MSG_ID
03-17 17:52:27.128: V/webview(19908): NEW_PICTURE_MSG_ID {0,0,313,353}
03-17 17:52:27.128: V/webview(19908): UPDATE_TEXT_ENTRY_MSG_ID
03-17 17:53:28.266: V/websync(19908): *** WebSyncManager sync ***
03-17 17:53:28.266: V/websync(19908): CookieSyncManager::syncFromRamToFlash STARTS
03-17 17:53:28.268: V/websync(19908): CookieSyncManager::syncFromRamToFlash DONE
</code></pre>
