Code example for View

Methods: getTag

0
     * @param text The text to display 
     * @param position The position withion the list 
     * @return The converted view 
     */ 
    public static View convertText(View convertView, String text, int position) {
        if(convertView.getTag() != null && ((String) convertView.getTag()).equals("text")) {
            ((TextView) convertView).setText(text);
            convertView.setId(position);
            return convertView;
 
        } else { 
            return null; 
        } 
    } 
     
    /** 
     * Create a text view ready to be a list item. 
     * 
     * @param position      The position within the list. 
     * @param context       The context. 
     * @param text          The text of the button