title: how to check condition for json array elements
body: <p>I am developing an app in which i am calling a service, in which data is coming as an array format.
  As shown below:</p>
  
  <pre><code>[  
   {  
    "Image":null,
    "FirstName":null,
    "Active":false,
    "HallTicketNumber":0,
    "ReportingTime":null,
    "EventDetails":null,
    "CompanyName":null,
    "Designation_Role":null,
    "EventDate":null,
    "StateName":null,
    "CityName":null,
    "FullAddress":null,
    "HallTicket_Status":"HETSTOP"
   }
  ]
  </code></pre>
  
  <p>In that i need to check the condition for <strong>HET_STATUS</strong>,if that StATUS is <strong>HET STOP</strong> then it should print that het stop. But <strong>when i am trying to check the condition it is showing nothing</strong>:</p>
  
  <p>Below is my code:</p>
  
  <pre><code>  String StringData = "" + data;
    try {
            JSONArray rootArray = new JSONArray(StringData);
            int len = rootArray.length();
            for (int i = 0; i &lt; len; ++i) {
                 JSONObject json = rootArray.optJSONObject(i);
  
                 String CompanyName = json.optString("CompanyName ");
                 String Position = json.optString("Designation_Role");
                 String EventDate = json.optString("EventDate");
                 String StateName = json.optString("StateName ");
                 String CityName = json.optString("CityName");
                 String Address = json.getString("FullAddress");
                 String ReportingTime = json.getString("ReportingTime");
                 String HallTicket_Status = json.getString("HallTicket_Status");
  
                 if (HallTicket_Status == "HETSTOP") {
                     Toast toast = Toast.makeText(UpcomingEventsDetails.this, "HET STOP", Toast.LENGTH_LONG);
                     toast.setGravity(Gravity.CENTER, 0, 0);
                     toast.show();
  </code></pre>