title: Android TextView : "Do not concatenate text displayed with setText"
body: <p>I am setting text using <strong>setText()</strong> by following way.</p>
  
  <pre><code>prodNameView.setText("" + name);
  
  prodOriginalPriceView.setText("" + String.format(getString(R.string.string_product_rate_with_ruppe_sign), "" + new BigDecimal(price).setScale(2, RoundingMode.UP)));
  </code></pre>
  
  <p>In that <strong>First</strong> one is simple use and <strong>Second</strong> one is setting text with formatting text.</p>
  
  <p>Android Studio is so much interesting, I used Menu <strong><code>Analyze -&gt; Code Cleanup</code></strong> and i got suggestion on above two lines like.</p>
  
  <p><a href="https://i.stack.imgur.com/Yz5f2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Yz5f2.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>Do not concatenate text displayed with setText. Use resource string
    with placeholders. less... (Ctrl+F1) </p>
    
    <p>When calling <strong>TextView#setText:</strong></p>
    
    <ul>
    <li>Never call Number#toString() to format numbers; it will not handle fraction separators and locale-specific digits properly. Consider
    using String#format with proper format specifications (%d or %f)
    instead. </li>
    <li>Do not pass a string literal (e.g. "Hello") to display text. Hardcoded text can not be properly translated to other languages.
    Consider using Android resource strings instead. </li>
    <li>Do not build messages by concatenating text chunks. Such messages can not be properly translated.</li>
    </ul>
  </blockquote>
  
  <p>What I can do for this? Anyone can help explain what the thing is and what should I do?</p>