views:

48

answers:

1

I am trying to implement a textview which has select text/copy and paste functionality. I tried to do this by making an Edittext with the following properties. I currently have the following Edittext:

<EditText style="?android:attr/textViewStyle" 
                                        android:editable="false" 
                                        android:background="@null" android:textColor="@null" 
                                        android:id="@+id/textbox"/> 

I want users to be able to highlight the text with long click --> select text. This works fine with the above code and the highlights of selected text come out fine. However I do not want the cursor to always be flashing. I successfully get rid of the cursor by using:

textBox.setCursorVisible(false); 

However with this change whenever a user long clicks and hits select text, the highlighted text no longer has any color over it. I have tried to change the color of the highligthed text to

textBox.setHighlightColor(android.graphics.Color.RED); 

But this does not seem to have any effect. Any suggestions will be

A: 

Anyone have a solution to this?

SurtaX