My problem is this I want to get exact text from Edit text with font that set in Edit text as well as Text size,text color and text style like bold, italic and underline.
till now i used Spannable like this Spannable messageText; and get the text from EditText like this
messageText = editText.getText();
and set into textview
textView.setText(messageText);
But in this case it return only the simple string not color,font,size and style.
EditText
<EditText
android:id="@+id/message"
android:layout_width="fill_parent"
android:layout_height="180dp"
android:inputType="textMultiLine"
android:singleLine="false"
android:tag="no"
android:textColor="#000000"
android:textSize="15sp"
android:textStyle="normal"
android:typeface="normal" />
TextView
<TextView
android:id="@+id/preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text=""
android:textColor="#000000"
android:textSize="15sp"
android:textStyle="normal"
android:typeface="normal" />
Help me, Thanks
If you are setting the background color of the edit text like this
Then,
Do this to get the background color.
And then set this color to the textView.