自定义对话框编辑文本无法在三星上更改



嗯,这是一个很奇怪的问题,我不确定是什么导致了这个问题。

现在,当我在此编辑文本中输入文本时,

我在自定义对话框中有一个编辑文本,它运行良好,但是当我尝试单击文本并编辑文本时,它不会让我这样做。

虽然它适用于我的某些设备,但不适用于我的任何三星设备。

这是 XML

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"   
    android:orientation="vertical" >
    <RelativeLayout 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/white_patch"
    android:id="@+id/dialogBackground"
    android:orientation="vertical" >
    <TextView
        android:id="@+id/whtlbl"
        style="@style/buttons"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="20dp"
        android:text="Send Message"
        android:textColor="@android:color/black"
        android:textSize="18dp" />


    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/whtlbl"
        android:layout_centerHorizontal="true"
        android:id="@+id/optionLayout"
        android:layout_marginTop="10dp" >
        <EditText 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/messageBox"
            android:padding="10dp"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:clickable="true"
            android:enabled="true"
            android:background="@drawable/textbox2"
            android:gravity="top|left"
            />
    </LinearLayout>
    <ImageView
        android:id="@+id/saveButton"
        style="@style/buttons"      
        android:layout_centerHorizontal="true"
        android:layout_below="@id/optionLayout"
        android:layout_marginTop="20dp"
        android:background="@drawable/send" />
    </RelativeLayout>
</RelativeLayout>  
you should create popup window in listener.
like :
 imgEditOk.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                lnPopupMain = (LinearLayout)inflater.inflate(R.layout.popup_route_edit, null);
                float width = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 200, activity.getResources().getDisplayMetrics());
                float height = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 250, activity.getResources().getDisplayMetrics());
                popupEditRoute = new PopupWindow(lnPopupMain, (int)width, (int)height, true);
                popupEditRoute.setBackgroundDrawable(new BitmapDrawable());
                popupEditRoute.setOutsideTouchable(true);
                popupEditRoute.showAtLocation(lnPopupMain, Gravity.CENTER, 10, 10);
            }
        });

最新更新