views:

46

answers:

1

Hello! I want to save something from a webpage (loaded into webview) into a Java variable. Is that possible?

Example: I have a webpage with written text: HELLO STACK!. How could I save that text into Java var (String foo = ?????)?

Could I do it with JavaScript/Java cooperation?

A: 

Launch an http request and save the response to text, then process it to get what you want, you wouldnt have to use a webview.

blindstuff
I've fund this http://bit.ly/bVshR0 (4. page)public class JSInterface {//window.jsinterface.specialClick() /** * This is not called on the UI thread. Post a runnable to invoke * loadUrl on the UI thread. */ public void specialClick() { handler.post(new Runnable() { public void run() { //webview.loadUrl("javascript:alert('Special Click Was Called');"); SAVE something TO STRING HERE!!!! } }); }}Could that help me anyhow?
MarkB
Done it some other way =) Thanks for help!
MarkB