简体   繁体   中英

JavascriptInterface Android passing arguments

I have a question if i call android function from javascript file and pass arguments to it, all arguments will be passed as Strings?

for example

Javascript

var cars = ["Saab", "Volvo", "BMW"];
API.CreateCars(cars);

Android site

CreateCars(String[] cars){...}

It will be working? Or i should pass cars array as one string and next parse it on android site to array?

我检查它,它可以通过这种方式传递数组。

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