Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- style="@android:style/Widget.TextView"
- android:editable="false"
- android:cursorVisible="false"
- android:longClickable="false"
- EditText Et; // initialize your edittext//
- Et.setCursorVisible(false);
- Et.setLongClickable(false);
- Et.setClickable(false);
- Et.setFocusable(false);
- Et.setSelected(false);
- Et.setKeyListener(null);
- Et.setBackgroundResource(android.R.color.transparent);
- android:focusable="false"
- android:inputType="none"
- android:longClickable="false"
- android:clickable="false"
- android:cursorVisible="false"
- android:editable="false"
- <?xml version="1.0" encoding="utf-8" ?>
- <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
- <solid android:color="#ffffff" />
- <stroke android:width="1dip" android:color="#000000"/>
- </shape>
- <TextView
- android:layout_width="0dp"
- android:layout_weight="1"
- android:layout_height="wrap_content"
- android:inputType="date"
- android:layout_column="1"
- android:id="@+id/dateFromTextView"
- android:layout_marginRight="3dp"
- android:background="@drawable/border"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:layout_gravity="center"
- android:gravity="center" />
- <EditText
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:id="@+id/txt_postContent"
- android:textSize="17sp"
- android:gravity="top|left"
- android:text="This is a dummy text "
- android:layout_below="@+id/img_empimage"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:enabled="false"
- android:background="@android:color/transparent"
- style="?android:attr/textViewStyle" />
- yourEditText.setTextColor(Color.parseColor("#000000"));
- InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
- imm.showSoftInput(postContent, InputMethodManager.SHOW_IMPLICIT);//shows keyboard
- int position = postContent.length();
- Editable text = postContent.getText();
- yourEditText.setBackground(getResources().getDrawable(R.drawable.border));//shows a border around your text view making it look like a edit text
- yourEditTex.setEnabled(true);//enables the edit text which we disabled in layout file
- yourEditTex.setCursorVisible(true);
- Selection.setSelection(text,position-1);`//places the cursor at the end of the text
- String s = postContent.getText().toString();
- yourEditText.setText(s);
- yourEditText.setEnabled(false);
- yourEditText.setTextColor(Color.parseColor("#000000"));
- yourEditText.setBackground(null);`
- <EditText
- android:id="@+id/editTextPassword"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="8dp"
- android:layout_marginBottom="8dp"
- android:inputType="none"
- android:imeOptions="actionDone"
- android:enabled="false"
- style="?android:attr/textViewStyle" />
Add Comment
Please, Sign In to add comment