Code example for Spannable

Methods: length, setSpan

0
        public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
            TextView textView = getGenericView();
            textView.setTextSize(16);
            textView.setText(getGroup(groupPosition).toString(), TextView.BufferType.SPANNABLE);
            Spannable spannable = (Spannable) textView.getText();
            spannable.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
            return textView;
        } 
 
        public boolean isChildSelectable(int groupPosition, int childPosition) {
            return true; 
        } 
 
        public boolean hasStableIds() { 
            return true; 
        } 
 
    } 
 
}