I have a an editText whose background I have set to transparent to make it look like a textView.
On the Onfocuschanged method, when in focus I set the background resource as
ph.setBackgroundResource(android.R.drawable.edit_text);
And when focus is removed I want to make it look like a textView again, so I set the background as
ph.setBackgroundColor(Color.TRANSPARENT);
But the text in the editText stays in the position of the previous background and does not return to its original position.
EDIT: Added xml code for the editText
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:text="Medium Text"
android:id="@+id/ph"
android:layout_alignBottom="@+id/textView12"
android:layout_toRightOf="@+id/textView12"
android:layout_toEndOf="@+id/textView12" />