Android.Filtering using if statement getting data from JSON
<p>I am reading all data from a <code>json</code> file but I want to filter out all "Delivered" delivery_status. So I use <code>if(status == jobj.getString(DELIVERY_STATUS))</code>. BUT NOTHING WORKS. please help me</p>

<p>The output MUST BE only:</p>

<pre><code>{"delivery_id":"1","client_firstname":"Jhonny",delivery_status":"Pending"}
{"delivery_id":"4","client_firstname":"Marie",delivery_status":"On the Road"}
</code></pre>

<p><strong>AndroidActivity.java (Code Snippet)</strong></p>

<pre><code>public static final String DELIVERY_ID = "delivery_id";
public static final String CLIENT_FIRSTNAME = "client_firstname";
public static final String DELIVERY_STATUS = "delivery_status";

JSONArray ja = response.getJSONArray("delivery");

                            for (int i = 0; i &lt; ja.length(); i++) {
                                JSONObject jobj = ja.getJSONObject(i);
                                HashMap&lt;String, String&gt; item = new HashMap&lt;String, String&gt;();
                                String status = "Delivered";

                                if(status == jobj.getString(DELIVERY_STATUS)) {
                                    item.put(DELIVERY_ID, jobj.getString(DELIVERY_ID));
                                    item.put(CLIENT_FIRSTNAME, jobj.getString(CLIENT_FIRSTNAME));
                                    item.put(DELIVERY_STATUS, jobj.getString(DELIVERY_STATUS));
                                }

                                Item_List.add(item);
                            } // for loop e
</code></pre>

<p><strong>.json file</strong></p>

<pre><code>"delivery":[{"delivery_id":"1","client_firstname":"Jhonny",delivery_status":"Pending"}
    {"delivery_id":"2","client_firstname":"Mario",delivery_status":"Delivered"}  
    {"delivery_id":"3","client_firstname":"Jason",delivery_status":"Delivered"}
    {"delivery_id":"4","client_firstname":"Marie",delivery_status":"On the Road"}]
</code></pre>