Code example for SectionIndexer

Methods: getPositionForSection

0
                event.getAction() == MotionEvent.ACTION_MOVE) {  
            if (sectionIndexter == null) {  
                sectionIndexter = (SectionIndexer) list.getAdapter();  
            }   
             
            int position = sectionIndexter.getPositionForSection(l[idx]);  
            if (position == -1) {  
                return true;   
            } 
             
            list.setSelection(position);  
        } else if(event.getAction() == MotionEvent.ACTION_UP) {
            tvIndex.setVisibility(View.GONE);
        } 
         
        return true; 
    }   
    protected void onDraw(Canvas canvas) {  
        Paint paint = new Paint();  
        paint.setColor(textColor);  
Contextual code suggestions in your IDE  Get Codota for Java