简体   繁体   中英

How To Execute JavaScript inside a WebView

i want to deactivate Telegram account inside my android app .
my problem is about an ajax form in this site https://telegram.org/deactivate
i can get the html elements by javascript and set them but i can't run JavaScript codes for many times.
in the other words i have an application have one edittext that user give self phone number to copy on site and my app click submit buttom on form automatically by JavaScript But when password sent from telegram to user phone number, i can't set this password in new password field of telegram deactivate website.
i use codes of this site:
http://www.techrepublic.com/article/pro-tip-inject-javascript-into-an-android-web-view-for-a-more-dynamic-ux/
all JavaScript codes execute in onPageFinished method for one time :( pls help

I dont think execute javascript is the error, but... if you need to execute javascript in your webview use this:

  wb = (WebView) findViewById(R.id.webview);
  wb.getSettings().setJavaScriptEnabled(true);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM