title: Android Arraylist find index
body: <p>I have an <code>ArrayList</code> of object in my <code>Fragment</code>.</p>
  
  <pre><code>ArrayList&lt;MenuListItem&gt; menuItems = new ArrayList&lt;MenuListItem&gt;();
  menuItems.add(new MenuListItem("Newsfeed", 20));
  menuItems.add(new MenuListItem("FriendsRequest", 1));
  menuItems.add(new MenuListItem("Messages", 2));
  
  private class MenuListItem {
      public String label;
      public int count;
  
      public MenuListItem(String label, int count) {
          this.label = label;
          this.count = count;
      }
  }
  </code></pre>
  
  <p>How can I find the index of object that has the label value "Messages" in my <code>ArrayList</code> from my <code>Activity</code>.</p>