This might be a simple Java issue I'm struggling with but I'm looking to the community to assist me here as I have hit a brick wall with this situation.

I successfully have data coming in off of a MySQL database and brought to the application through JSON. During parsing I was trying to create another array to be passed onto an ArrayAdapter to be used in a ListView. Here is the code I'm having an issue with:

```
 try{

       jArray = new JSONArray(result);
       JSONObject json_data=null;

           for(int i=0;i<jArray.length();i++){
              json_data = jArray.getJSONObject(i);
              ct_id=json_data.getString("ID");
              ct_name=json_data.getString("Player2N");

              Games game_data[] = new Games[]
              {
                new Games(ct_id, ct_name)     
              };

           }

           GameAdapter adapter = new GameAdapter(this, R.layout.listview_item_row, game_data);

           listView1 = (ListView)findViewById(R.id.listView1);

           View header = (View)getLayoutInflater().inflate(R.layout.listview_header_row, null);
           listView1.addHeaderView(header);
           listView1.setAdapter(adapter);
 }    

```

This line: `GameAdapter adapter = new GameAdapter(this, R.layout.listview_item_row, game_data);`

More specifically the game\_data is highlighted red in Eclipse. Where I am curious is why does game\_data get out of reach after end of loop? I'm just trying to add specific fields within the row from JSON to the adapter here.

I also tried going through the loop within setting up the array but still no dice as new Games[] gets an error. Here is an example:

```
   Games game_data[] = new Games[]
                       {
                        for(int i=0;i<jArray.length();i++){
                         json_data = jArray.getJSONObject(i);
                         ct_id=json_data.getString("ID");
                          ct_name=json_data.getString("Player2N");

//                  Games game_data[] = new Games[]
  //                {
                    new Games(ct_id, ct_name);    
    //              };

               }

```

**error: Variable must either provide dimension expressions or array initializer.**