karthi karthi - 5 months ago 21
Java Question

Fetch Data from SQL Database (No MYSQL DB) (in android) using JSON with PHP

I tried the following code

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();
    }


but I get this warning in this line

personList= new ArrayList<HashMap<String,String>>();


 

Answer

this is working perfect for me

personList = new ArrayList<>();