title: How to avoid ListView put rows with TextView transparent
body: <p>I'm developing a Chat App, so I create  a list of friends. </p>
  
  <p>Take a look at my ListView declaration at layout.xml</p>
  
  <pre><code>&lt;ListView
          android:listSelector="@android:color/transparent"
          android:id="@+id/usersList"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_marginLeft="2dp"
          android:layout_marginRight="2dp"
          android:background="@android:color/transparent"
          android:cacheColorHint="@android:color/transparent"
          android:divider="@android:color/transparent"
          android:dividerPadding="2dp"
          android:overScrollFooter="@null"
          android:scrollingCache="false"
          android:transcriptMode="normal"
          /&gt;
  </code></pre>
  
  <p>And the behavior of this ListView is annoying.</p>
  
  <p>When I run my app in a phone with Android 2.3 the TextView itens of my ListView becomes transparent just like the image below:</p>
  
  <p><img src="https://i.stack.imgur.com/ytLs1.png" alt="enter image description here"></p>
  
  <p>Sometimes when a press the itens the color of TextView back to normality.</p>
  
  <p>When I run my app in a phone with Android 4.1 this problem not happens.</p>
  
  <p><img src="https://i.stack.imgur.com/7ccxZ.png" alt="enter image description here"></p>
  
  <p>My user item xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@android:color/white"
      android:orientation="vertical" &gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="horizontal"
          android:padding="5dp" &gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_weight="1"
              android:orientation="vertical" &gt;
  
              &lt;ImageView
                  android:layout_width="65dp"
                  android:layout_height="65dp"
                  android:layout_gravity="center"
                  android:layout_margin="5dp"
                  android:adjustViewBounds="true"
                  android:src="@drawable/quick_blox_user" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_weight="0.5"
              android:orientation="vertical" &gt;
  
                  &lt;TextView
                  android:cacheColorHint="@android:color/transparent"
                  android:id="@+id/text_view_user"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="asdasdad"
                  android:textColor="@color/text_gray"
                  android:textSize="25sp" /&gt;
  
                  &lt;TextView 
                  android:cacheColorHint="@android:color/transparent"
                  android:id="@+id/text_view_user_last_activity"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="asdasdad"
                  android:textColor="@color/text_gray_light"
                  android:textSize="12sp" /&gt;
  
              &lt;LinearLayout
                  android:id="@+id/layout_pending_messages"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal" &gt;
  
                  &lt;Button
                      android:id="@+id/button_message_pending_number"
                      android:focusable="false"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_margin="1dp"
                      android:background="@color/color_new_message_title"
                      android:padding="2dp"
                      android:text="12"
                      android:textColor="@android:color/white"
                      android:textSize="24sp" /&gt;
  
                  &lt;TextView
                      android:id="@+id/text_view_user_last_activity"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_margin="1dp"
                      android:text="@string/pending_messages"
                      android:textColor="@color/color_new_message"
                      android:textSize="14sp" /&gt;
              &lt;/LinearLayout&gt;
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>My Adapter:</p>
  
  <pre><code>public class UserAdapter extends BaseCustomAdapter&lt;UserItem&gt; {
  
      public UserAdapter(Activity a, List&lt;UserItem&gt; d) {
          super(a, d); 
      }
  
      @Override
      public View getView(int position, View view, ViewGroup parent) {
          if(view == null) {
              view = LayoutInflater.from(activity).inflate( R.layout.user_quickblox_item, null);  
          }
  
          UserItem user  = data.get(position); 
  
          String userLogin = user.getUser().getLogin();
          int index = userLogin.indexOf("@");
          if(index != -1) {
              userLogin = userLogin.substring(0, index);
          }
          int count = ChatMessageDAO.getInstance(activity).countMessagePendentBySenderId(user.getUser().getId());
  
          View viewPendingMessages = view.findViewById(R.id.layout_pending_messages);
          if(count == 0) {
              viewPendingMessages.setVisibility(View.GONE);
          } else {
              viewPendingMessages.setVisibility(View.VISIBLE);
              Button buttonMessageNumberIndicator = (Button)view.findViewById(R.id.button_message_pending_number);
              buttonMessageNumberIndicator.setText(String.valueOf(count));
          }
  
          TextView textViewUser = (TextView)view.findViewById(R.id.text_view_user);
          textViewUser.setText(userLogin);
  
          TextView textViewUserLastActivity = (TextView)view.findViewById(R.id.text_view_user_last_activity);
  
  
          long diff = new Date().getTime() - user.getUser().getLastRequestAt().getTime();  
          long diffInDays =  TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);
          if(diffInDays == 0) {
              long diffInHours =  TimeUnit.HOURS.convert(diff, TimeUnit.MILLISECONDS);
              if(diffInHours == 0) {
                  long diffInMinutes =  TimeUnit.MINUTES.convert(diff, TimeUnit.MILLISECONDS);
                  if(diffInMinutes &lt; 0) {
                      textViewUserLastActivity.setText("Esta online agora");  
                  }  else {
                      textViewUserLastActivity.setText("Entrou hoje " + diffInMinutes+ " minuto(s) atrás");   
                  }
              } else {
                  textViewUserLastActivity.setText("Entrou hoje " + diffInHours+ " horas atrás");
              }
  
          } else if(diffInDays == 1) {
              Calendar calendar = Calendar.getInstance();
              calendar.setTime(user.getUser().getLastRequestAt());
              int hour = calendar.get(Calendar.HOUR_OF_DAY); 
              textViewUserLastActivity.setText("Entrou ontem as " + hour + " horas");  
          } else {
              textViewUserLastActivity.setText("Entrou " + diffInDays  + " dia(s) atras");    
          }
  
          return view;
      } 
  
  }
  </code></pre>
  
  <p>How to avoid this problem?</p>