title: Get the text height including the font size and set that height
body: <p>i have a text called <code>Hello</code> now i need to apply fontsize for this say 12 or 18 now as soon as we apply font to the text the text size increases.</p>
  
  <p>so now i need to get the text height including the font size using paint.</p>
  
  <p>i have tried with paint the following:</p>
  
  <pre><code>String finalVal ="Hello";
  
  Paint paint = new Paint();
  paint.setTextSize(18);
  paint.setTypeface(Typeface.SANS_SERIF);
  paint.setColor(Color.BLACK);
  paint.setStyle(Paint.Style.FILL);
  
  Rect result = new Rect();
  // Measure the text rectangle to get the height
  paint.getTextBounds(finalVal, 0, finalVal.length(), result);
  </code></pre>
  
  <p>But its not working , please help</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>i am trying to set the height of webview dynamically based on the textheight i am getting the text height for single line like <code>"Hello"</code> but if there are two lines in the text <code>"My name is abc and my dads name is xyz and my moms name is 123" now its not getting the proper text height".</code> </p>