title: set imagespan in the next line of text and in the center
body: <p>I want to add an image to the edit text and I am successful in adding an image. Now I want this image in the next line and in the center. I want my image to be inserted in the center of the horizontal layout and not to one side. I searched a lot of posts but could not find my answer. Here are two images what my results are now and what I want in reality.</p>
  
  <p><a href="https://i.stack.imgur.com/CDKML.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CDKML.jpg" alt="enter image description here"></a></p>
  
  <p>and this I want</p>
  
  <p><a href="https://i.stack.imgur.com/mIklr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mIklr.jpg" alt="enter image description here"></a></p>
  
  <p>my code for Imagespan is </p>
  
  <pre><code>private void setImageinText(Bitmap myBitmap){
     myBitmap = scaleDown(myBitmap, 1360, true);
      imageView = new ImageView(context);
      imageView.setImageBitmap(myBitmap);
      Drawable d = imageView.getDrawable();
     SpannableString ssd = new SpannableString("abcde");
     d.setBounds(0, 0, d.getIntrinsicWidth()/2, d.getIntrinsicHeight()/2);
     ImageSpan span = new ImageSpan(d, ImageSpan.ALIGN_BASELINE);
     ssd.setSpan(span, 0, 5, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
     texto.setTransformationMethod(null);
     texto.getText().insert(texto.getSelectionStart(), ssd);
  }
  </code></pre>