我尝试了以下代码
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
list = (ListView) findViewById(R.id.listView);
personList = new ArrayList<HashMap<String,String>>();//Warning in this line Explicit type arg <> diamond
getData();
}
但我在这一行收到此警告
personList= new ArrayList<HashMap<String,String>>();
最佳答案
更换你的
personList = new ArrayList<HashMap<String,String>>();
行至
personList = new ArrayList<>();
关于java - 使用 JSON 和 PHP 从 SQL 数据库(无 MYSQL DB)(在 android 中)获取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37431773/