Code example for ListView

Methods: setSelection

0
     * 
     * @param position 
     */ 
    public void setSelection(int position) {
        ensureList(); 
        mList.setSelection(position);
    } 
 
    /** 
     * Get the position of the currently selected list item. 
     */ 
    public int getSelectedItemPosition() { 
        ensureList(); 
        return mList.getSelectedItemPosition();
    } 
 
    /** 
     * Get the cursor row ID of the currently selected list item. 
     */ 
    public long getSelectedItemId() { 
        ensureList();