title: How to dynamically change the text size in Android
body: <p>I want to implement a function,</p>
  
  <p>EditText user when entering text, you can make changes in accordance with the set font size,</p>
  
  <p>Such as Google Docs of Office,</p>
  
  <p><a href="https://i.stack.imgur.com/mroGl.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mroGl.png" alt="enter image description here"></a></p>
  
  <p>Now I found a way to <code>SpannableString</code>, but read some examples seem unable to reach my needs</p>
  
  <pre><code>int index = input.getSelectionEnd();
  SpannableString  spann = new SpannableString(show_input);
  AbsoluteSizeSpan word_size = new AbsoluteSizeSpan(18,true);
  spann.setSpan(word_size, 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
  input.getText().insert(index, spann);
  </code></pre>
  
  <p>So is there any way to provide it?</p>