Code example for Spinner

Methods: getSelectedItemId

0
    } 
     
    private void saveState() { 
        String title = mTitleText.getText().toString();
        String body = mBodyText.getText().toString();
        long priority = spinner.getSelectedItemId();
         
        if (priority == -1 )
        	priority = 0;
 
        if (mRowId == null) {
            long id = mDbHelper.createNote(title, body, (int)priority, mDay, mMonth, mYear);
            if (id > 0) {
                mRowId = id;
            } 
        } else { 
            mDbHelper.updateNote(mRowId, title, body, (int)priority, mDay, mMonth, mYear);
        } 
    }