alex23434
alex23434

Reputation: 399

Variables inside Javascript injection [webview]

So I have this line of code:

myWebview.loadUrl("javascript:document.getElementById('join_confirm_email').value='[email protected]';void(0);");

for the value inside the javascript injection ([email protected]), I want to use a variable written inside my onCreate method. Is this possible? If it is, how can I do it?

Upvotes: 0

Views: 266

Answers (1)

Ozgur
Ozgur

Reputation: 3766

Something like that.

String emailSTR = "[email protected]";
myWebview.loadUrl("javascript:document.getElementById('join_confirm_email').value='"+emailStr+"';void(0);");

Upvotes: 1

Related Questions