Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

218
Views
Vista web de Android, evalúe Javascript y obtenga valores como Array

Estoy tratando de obtener resultados de JavaScript usando el método webView.evaluateJavascript. Puedo obtener el valor de retorno como tipo de cadena. Cuando cambié el tipo de variable de String a String[], genera automáticamente esta línea de código

(ValueCallback) nuevo ValueCallback<String[]>().

 public void getDataFromJs(String command, WebView webView) { webView.evaluateJavascript("(function() {" + command + "; })();", (ValueCallback<String>) new ValueCallback<String[]>() { @Override public void onReceiveValue(String[] s) { MyList=s.clone(); } });

error: tipos incompatibles: <Anonymous ValueCallback<String[]>> no se puede convertir a ValueCallback

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Creo que debes cambiar la firma de esta manera:

webView.evaluateJavascript("(function() {" + command + "; })();", (ValueCallback<String[]>) new ValueCallback<String[]>() {}

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!