-1

I am using text field in a popup in android. But there is no copy/paste option in text field. I used the same text field in different activity, and it is working fine. My popup xml is below:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/popup_element"
        android:background="@color/colorPrimary"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
    android:weightSum="1">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="54dp">

        <TextView
            android:text="Add HTTP Link"
            android:textSize="25dp"
            android:textStyle="bold"
            android:textColor="@color/colorwhite"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/textView2"
            android:layout_centerVertical="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_marginLeft="17dp"
            android:layout_marginStart="17dp"
            android:textAppearance="@style/TextAppearance.AppCompat.Body2" />
    </RelativeLayout>

    <LinearLayout
        android:background="@color/colorwhite"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <Button
                android:id="@+id/btn_close_popup"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:textColor="@color/colorPrimaryDark"
                android:text="Cancel"
                android:layout_alignBaseline="@+id/button_download"
                android:layout_alignBottom="@+id/button_download"
                android:layout_toRightOf="@+id/button_download"
                android:layout_toEndOf="@+id/button_download"
                android:layout_weight="1" />

            <Button
                android:text="Download"
                android:textColor="@color/colorPrimaryDark"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/button_download"
                android:layout_marginLeft="62dp"
                android:layout_marginStart="62dp"
                android:layout_marginBottom="18dp"
                android:layout_weight="1"
                android:layout_alignParentBottom="true"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true" />

            <android.support.design.widget.TextInputLayout
                android:id="@+id/texthttp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="90dp"
                android:layout_alignParentTop="true"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true">
                <EditText
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textUri"
                    android:hint="Http Link" />
            </android.support.design.widget.TextInputLayout>



        </RelativeLayout>

    </LinearLayout>

</LinearLayout>

There is no java class for the popup. Tried different methods like isSelectable but no help.. Please help. Thank you

  • you can use [android:textIsSelectable](https://developer.android.com/reference/android/widget/TextView.html) – TranHieu Apr 13 '17 at 09:37

1 Answers1

0

I finally found an alternative to this, by replacing popup with dialog fragment. Now it working fine. From deep searching in internet, I came to know that it is a bug in popup from google. Dialog fragment is working fine. Anyway thank you for spending your valuable time...