title: How do I change textview color in listview as per data
body: <p>I get parking slot number and its respective status of particular area from sql database and populate list view in onpostexecute method of async class. Now i need to change the color af text view as green if status is 0,as red if status is 1, as orange is status is 1. </p>
  
  <p>I used hashmap to store slot number and status in jet value pair. I tried to get data from textview and change as per it but it shows null as listview and listview item are in different layout.</p>
  
  <p>My code to get data and populate list view</p>
  
  <pre><code>     public class GetHttpResponse extends AsyncTask&lt;Void, Void, String&gt; {
      public Context context;
  
      public GetHttpResponse(Context context) {
          this.context = context;
      }
  
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
      }
  
      @Override
      protected String doInBackground(Void... arg0) {
          String SetServerString = "";
          Log.d("json",FinalJSonObject);
          try {
              if (FinalJSonObject != null) {
                  JSONArray jsonArray = null;
  
  
                  try {
  
                      jsonArray = new JSONArray(FinalJSonObject);
  
                      JSONObject jsonObject;
  
                      for (int i = 0; i &lt; jsonArray.length(); i++) {
                          jsonObject = jsonArray.getJSONObject(i);
  
                          // Storing Student Name, Phone Number, Class into Variables.
                          sno = jsonObject.getString("slot_number").toString();
                          status = jsonObject.getString("reserv_status").toString();
  
  
                          HashMap&lt;String, String&gt; slot = new HashMap&lt;&gt;();
                          // adding each child node to HashMap key =&gt; value
                          slot.put("sno", sno);
                          slot.put("status", status);
  
  
                          // adding contact to contact list
                          slotList.add(slot);
  
  
                      }
                  } catch (JSONException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
              }
          } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
          return SetServerString ;
      }
  
      @Override
      protected void onPostExecute(String result) {
       Log.d("bhjg",result);
          // Setting Student Name, Phone Number, Class into TextView after done all process .
          ListAdapter adapter = new SimpleAdapter(
                  ShowSingleRecordActivity.this, slotList,
                  R.layout.slotlist_item, new String[]{"sno","status"}, new int[]{R.id.textView1,R.id.textView2
          });
  
          lv.setAdapter(adapter);
        /*  TextView v1=(TextView)findViewById(R.id.textView1);
          TextView vh=(TextView)findViewById(R.id.textView2);
          String v=vh.getText().toString();
          if (slot.get("status").equals("0"))
          {
           v1   .setTextColor(Color.parseColor("#008000"));
          }
         else if (v.equals("1"))
          {
              v1   .setTextColor(Color.parseColor("#ff0000"));
          }
          else if (v.equals("2"))
          {
              v1   .setTextColor(Color.parseColor("#FFA500"));
          }*/
      }
  }
  </code></pre>
  
  <p>I expect the list view with textview in respective colour differentiation</p>