Sorry, for this dumb question…
But I can’t understand how I should write correctly. Here is what I want:
long selectedCartId = cartsSpinner.getSelectedItemId();
if (selectedCartId != AdapterView.INVALID_ROW_ID)
CartDataSource.insertProduct(selectedCartId, prodId, count);
but eclipse generates error for the if-condition:
Incompatible operand types long and Class< INVALID_ROW_ID>
INVALID_ROW_ID is declared as this:
public abstract class android.widget.AdapterView extends android.view.ViewGroup {
// <Skipped>
public static final long INVALID_ROW_ID = -9223372036854775808L;
}
So, the problem was in not cleared project.