title: How to use AdapterView.INVALID_ROW_ID?
body: <p>Sorry, for this dumb question...</p>
  
  <p>But I can't understand how I should write correctly. Here is what I want:</p>
  
  <pre><code>long selectedCartId = cartsSpinner.getSelectedItemId();
  if (selectedCartId !=  AdapterView.INVALID_ROW_ID)
       CartDataSource.insertProduct(selectedCartId, prodId, count);
  </code></pre>
  
  <p>but eclipse generates error for the if-condition:</p>
  
  <blockquote>
    <p>Incompatible operand types long and Class&lt; INVALID_ROW_ID></p>
  </blockquote>
  
  <hr>
  
  <p><a href="http://developer.android.com/reference/android/widget/AdapterView.html#INVALID_ROW_ID" rel="nofollow"><strong>INVALID_ROW_ID</strong></a> is declared as this:</p>
  
  <pre><code>public abstract class android.widget.AdapterView extends android.view.ViewGroup {
  
  // &lt;Skipped&gt;
  
      public static final long INVALID_ROW_ID = -9223372036854775808L;
  
  }
  </code></pre>