title: list.contains() is not working in android
body: <p>list.contains is not working.
  Here is my list which gets data from database.</p>
  
  <pre><code>////////List/////////////////
  public List&lt;Comment&gt; getAllComments() {
          List&lt;Comment&gt; comments = new ArrayList&lt;Comment&gt;();
  
          Cursor cursor = database.query(MySQLiteHelper.TABLE_COMMENTS,
                  allColumns, null, null, null, null, null);
  
          cursor.moveToFirst();
          while (!cursor.isAfterLast()) {
              Comment comment = cursorToComment(cursor);
              comments.add(comment);
              cursor.moveToNext();
          }
          // make sure to close the cursor
          cursor.close();
          return comments;
      }
  /////////////////////////////////////////////
  
  
  
  
  
      datasource = new CommentsDataSource(this);
          datasource.open();
          final List list;
          list = datasource.getAllComments();
  
  button.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  if(list.contains("Hello")){
                      Toast.makeText(getApplicationContext(), "List Contains data", Toast.LENGTH_SHORT).show();
                  } ///////Here it always return false///////
  else{
   Toast.makeText(getApplicationContext(), "Data not found", Toast.LENGTH_SHORT).show();
  }
              }
          });
  }
  ////////////////////////////////////////////////////
  </code></pre>
  
  <p>My list contais Hello but i don't know why its not working. &amp; sorry if it is already asked. The thing is i want some example code, regarding my codes Thanks in advance.</p>