I am using following code
LayoutInflater inflater = (LayoutInflater) getActivity()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View innerView = inflater.inflate(R.layout.ac_image_list, null);
TextView tv = (TextView) innerView.findViewById(R.id.tv_sorting);
tv.setText(Html.fromHtml(getString(R.string.sort_by_num_messages)));
The String sort_by_num_messages is defined as
<string name="sort_by_likes"><![CDATA[Sort by <b>Messages</b>]]></string>
The problem is that it is displayed as follows: Sort by < b >Messages< / b >
The code was working in an other activity there I was not using the LayoutInflator. The code is used in a SherlockFragment used as Tab.