SpannableString(Builder) is not selectable in EditText
<p>I have created an EditText and added some text which contains formatting to it as in the following code:</p>

<pre><code>    EditText richTextView = (EditText)findViewById(R.id.rich_text);

    // this is the text we'll be operating on  
    SpannableStringBuilder text = new SpannableStringBuilder("Lorem ipsum dolor sit amet");  

    // make "Lorem" (characters 0 to 5) red  
    text.setSpan(new ForegroundColorSpan(Color.RED), 0, 5, 0); 

    // make "ipsum" (characters 6 to 11) one and a half time bigger than the textbox  
    text.setSpan(new RelativeSizeSpan(1.5f), 6, 11, 0);  

    // make "dolor" (characters 12 to 17) display a toast message when touched  
    final Context context = this;  
    ClickableSpan clickableSpan = new ClickableSpan() {  
        @Override  
        public void onClick(View view) {  
            Toast.makeText(context, "dolor", Toast.LENGTH_LONG).show();  
        }  
    };  
    text.setSpan(clickableSpan, 12, 17, 0);  

    // make "sit" (characters 18 to 21) struck through  
    text.setSpan(new StrikethroughSpan(), 18, 21, 0);  

    // make "amet" (characters 22 to 26) twice as big, green and a link to this site.  
    // it's important to set the color after the URLSpan or the standard  
    // link color will override it.  
    text.setSpan(new RelativeSizeSpan(2f), 22, 26, 0);  
    text.setSpan(new ForegroundColorSpan(Color.GREEN), 22, 26, 0);  

    // make our ClickableSpans and URLSpans work  
    richTextView.setMovementMethod(LinkMovementMethod.getInstance());  

    // shove our styled text into the TextView          
    richTextView.setText(text, BufferType.EDITABLE);
</code></pre>

<p>My problem is that the text is not selectable when running the program (tried on both the emulator and my own device). If I click on any of the words except "dolor", no cursor appears, but if I type, it starts typing from before "Lorem". However, if I click "dolor", it selects the word and I can replace it (but I can't type without replacing).</p>

<p>I can't select any other parts of the words, and can't place the cursor where I want it (it doesn't even show up).</p>

<p>I am wondering how I can get normal text selection features like those that are present when using normal text instead of SpannableString or SpannableStringBuilder? (I have tried both) If I use plain text, I can select any part of any word and start inputting text from there.</p>

<p><strong>Edit1</strong>
The text selection works in landscape mode, but not in portrait. So the code is valid to some degree...</p>

<p><strong>Edit2</strong>
Actually text selection works in landscape mode on my phone, but not on the emulator.</p>
