问题
After reciving the Data from the PHP-File with a MySQL-query, I want to fill two Array with the data. The first Array works:
results.add((String) json_data.get("product") + "\n" + json_data.get("owner"));
But when I add the second Array:
mysql_id.add((String) json_data.get("id"));
Eclipse displays a Error:
The method add(String) is undefined for the type String
There a no suggestions available and I dont know the Problem. I have "mysql_id" everywhere declard as "results" but it doesnt work!
Thanks for Help!
回答1:
you have to use like this
mysql_id.add(getString("id"));
来源:https://stackoverflow.com/questions/12620166/the-method-addstring-is-undefined-for-the-type-string-jsonobject-2nd-array