1

I can able to getting text but not all tags works properly.The bold and italic tag not working where break tag works.

My String.xml is:

<resources>
<string name="app_name">MyAppTXT_PageSplit</string>
<string name="text_to_show" formatted="false">
    <![CDATA[
       <i><b>Forbes Leadership, 2015</b></i><br><br>
       Your Emotional Intelligence (EI) directly relates to your ability to lead people successfully. One of many studies correlating Executives’ EI scores with their company’s profitability demonstrated that those with higher EI capabilities were more likely to be highly profitable (Leadership & OD Journal ,2009)

       <br><br>LeaderShaper is a self-development tool for professionals to develop their Emotional Intelligence as a key step to becoming a better leader and enabling high performance. Focus on one set of competencies at a time and get some real practical advice on how to improve your EI through behavioural change.  You can repeat it to see how your scores improve.
       <br><br>Just enter your own ratings against each of the questions.  When you complete a section, click on the ADVICE button for practical advice to help you improve your EI.
       <br><br>Once you have completed the questionnaire, you can obtain a LeaderShaper Pro Report for £2.99, showing how your EI profile rates against each of the six recognised leadership styles.
       <br><br>
       <b>&#8226;</b>   &#160;&#160;&#160;&#160; Visionary, Coaching, Democratic, Affiliative, Pacesetting &amp; Commanding <br>
    ]]>
</string>

And My code to set TextView text is:

txt_show.setText(Html.fromHtml(getResources().getString(R.string.text_to_show)));
  • please prefer following link http://stackoverflow.com/questions/1529068/is-it-possible-to-have-multiple-styles-inside-a-textview – Dhaval Solanki Mar 29 '16 at 07:28

2 Answers2

0

Remove formatted="false" from

  <string name="text_to_show" formatted="false">

or set it to true.

Android Geek
  • 8,956
  • 2
  • 21
  • 35
0

i have checked your code and try in my app, but its working fine. may be there some android version issue or device issue.enter image description here

Mehul Santoki
  • 1,208
  • 1
  • 12
  • 25