I'm a beginner to Android Studio and I'm just learning how to read in JSON files. I used logcat to find out that I'm getting an exception on the line declaraing the JSONArray dataList. My code is below for reference.
try{
            JSONObject jsonObject = new JSONObject(loadJSONFromAsset());
            JSONArray dataList = jsonObject.getJSONArray("eateries");
            //Log.d("test", String.valueOf(dataList.length()));
            for(int i = 0; i < dataList.length(); i++){
                String EateryName = dataList.getJSONObject(i).getString("name");
                EateryList.add(EateryName);
            }
        }catch (JSONException e){
            e.printStackTrace();
            //Log.d("test", "exception");
        }
 
     
     
    
