I'm trying to store all values from a drop down box into variables within my android application. I'm trying to get all options from the below into strings in my app;
<select name="cardId" id="select_card_no" onfocus="null" onchange="null">
<option value="">Choose card number</option>
<option value="010607655930" >010607655930</option>
<option value="050538806749" >050538806749</option>
<option value="054100790989" >054100790989</option>
</select>
I've been using code like this to intially log through parts of the site;
public void onPageFinished(WebView view, String url) {
if(url == "https://oyster.tfl.gov.uk/oyster/entry.do"){
String ausername = "abcde";
String apassword = "12345";
view.loadUrl("javascript:document.getElementsByName('j_username')[0].value = '"+ausername+"'");
view.loadUrl("javascript:document.getElementsByName('j_password')[0].value = '"+apassword+"'");
view.loadUrl("javascript:document.forms[0].submit()");
}
But was wondering how you could possibly get text back from the current Webview state, can you somehow convert loadUrl into a string;
String ddl = view.loadUrl("javascript:document.getElementById('select_card_no')");