How to make list header and footer not click able?
<p>I have a list with footer and header. I added onLongClick to delete item from list. When I press long on header it remove first item from list. When I click on last item or footer the app will crash- item out of range.</p>

<blockquote>
  <p><strong>Can I make footer and header not clickable? or how should i count item in adapter? or is there some other way to baypass it?</strong> </p>
  
  <blockquote>
    <p>Removing items: </p>
  </blockquote>
</blockquote>

<pre><code>list.setOnItemLongClickListener(new OnItemLongClickListener() {
        public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View v,
                int position, long id) {
            // Delete Item from List

            ShoppingItem simpleItem = null;

            if (shoppingListApplication.getAdapter().getCount() &gt; 0) {
                simpleItem = (ShoppingItem) shoppingListApplication
                        .getAdapter().getItem(position);
                removeShoppingItem(simpleItem,
                        shoppingListApplication.getAdapter());

            }
</code></pre>
