I am using the StackExchange API in my application which returns a response like this :
{  
   "items":[  
      {  
         "tags":[  
            "android",
            "gridview",
            "android-fragments",
            "android-activity"
         ],
         "owner":{  
            "reputation":30,
            "user_id":3303863,
            "user_type":"registered",
            "profile_image":"https://i.stack.imgur.com/44pCy.jpg?s=128&g=1",
            "display_name":"chris.b",
            "link":"http://stackoverflow.com/users/3303863/chris-b"
         },
         "is_answered":false,
         "view_count":7,
         "answer_count":0,
         "score":0,
         "last_activity_date":1429979620,
         "creation_date":1429979620,
         "question_id":29867827,
         "link":"http://stackoverflow.com/questions/29867827/android-app-close-without-error-on-click-of-the-first-gridview-item",
         "title":"Android App Close without Error, on click of the first gridview Item"
      },
      {  
         "tags":[  
            "android",
            "genymotion"
         ],
         "owner":{  
            "reputation":61,
            "user_id":213199,
            "user_type":"registered",
            "accept_rate":54,
            "profile_image":"https://www.gravatar.com/avatar/2f0b0c0e0e449255b5e2892b10b97ba4?s=128&d=identicon&r=PG",
            "display_name":"Stella",
            "link":"http://stackoverflow.com/users/213199/stella"
         },
         "is_answered":false,
         "view_count":7,
         "answer_count":0,
         "score":0,
         "last_activity_date":1429979268,
         "creation_date":1429979268,
         "question_id":29867773,
         "link":"http://stackoverflow.com/questions/29867773/unable-to-run-android-app-in-genymotion-emulator",
         "title":"Unable to run Android app in Genymotion emulator"
      },
And I am using the following code to get a string from the URL :
public String readJSON() {
    HttpClient client = new DefaultHttpClient();
    HttpGet httpGet = new HttpGet(url);
    HttpResponse response = null;
    try {
        response = client.execute(httpGet);
    } catch (IOException e) {
        e.printStackTrace();
    }
    StatusLine statusLine = response.getStatusLine();
    int statusCode = statusLine.getStatusCode();
    if (statusCode == 200) {
        HttpEntity entity = response.getEntity();
        InputStream content = null;
        try {
            content = entity.getContent();
        } catch (IOException e) {
            e.printStackTrace();
        }
        BufferedReader reader = new BufferedReader(new InputStreamReader(content));
        String line;
        try {
            while ((line = reader.readLine()) != null) {
                builder.append(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    } else {
        //Log.e(re.class.toString(), "Failed to download file");
    }
    return builder.toString();
}
and I am using an Async task to display the questions in a text view like this :
public class JSONTask extends AsyncTask<String,String,JSONObject>
{
    private ProgressDialog pDialog;
    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        pDialog = new ProgressDialog(MainActivity.this);
        pDialog.setMessage("Getting Data ...");
        pDialog.setIndeterminate(false);
        pDialog.setCancelable(true);
        pDialog.show();
    }
    @Override
    protected JSONObject doInBackground(String... params) {
        try {
            ob1 = new JSONObject(readJSON());
        } catch (JSONException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return ob1;
    }
    @Override
    protected void onPostExecute(JSONObject jsonObject) {
        try {
            mJSONArr = jsonObject.getJSONArray("items");
            for(int i=0;i<20;i++)
            {
                ob2 = mJSONArr.getJSONObject(i);
                holder+=ob2.getString("title");
            }
            tv.setText(holder);
            pDialog.dismiss();
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
}
But I am getting an error saying
"Attempt to invoke virtual method 'org.json.JSONObject org.json.JSONArray.getJSONObject(int)' on a null object reference"
on these lines :
        mJSONArr = ob1.getJSONArray("items");
and
public class JSONTask extends AsyncTask<String,String,JSONObject>
How do I fix this? Also ,how do I access the 'display name' from the 'owner' object in this JSON response ?
Thanks