1

i can't figure out how getting all javascript methods and their parameters from webview inside a fragment and calling specific java methods for each one;

In my fragment i have an html code like this :

String str="<div class=\"comment-page\" onclick=\"addComment(16802)\" style=\"margin-bottom:30px;background:none no-repeat right center #F4ECE1; padding-top:5px;padding-bottom:5px;border-top:3px solid #401B01; padding-left:5px; font-size:16px;\">add comment <img src=\"add.png\"/></div> content.loadDataWithBaseURL("http://www.mysite.com/",str, "text/html", "UTF-8", null); 

when i click on "add comment" i would like to show new activity or new fragment that contains a webview with input fields and "send" button which also has a javascript method .

4
  • Check this post: stackoverflow.com/questions/3737439/… Commented Apr 19, 2013 at 18:07
  • that for links presents in webview,not for javascript code Commented Apr 20, 2013 at 15:21
  • you can have javascript code redirect to another url, I didn't try but it might catch the callback Commented Apr 20, 2013 at 15:28
  • there is "addComment" function in js code portion with a parameter ,i would like to open new activity with an intent and put in this paramter.i hope that you understand me Commented Apr 20, 2013 at 23:35

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.