Domanda

which is added to rootView = (FrameLayout) activity.findViewById(android.R.id.content); using method rootView.addView(View child).

Here is it's layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/popup_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/transparent" >

    <RelativeLayout
        android:id="@+id/popup"
        android:layout_width="284dp"
        android:layout_height="302dp"
        android:background="@drawable/ll_popup_background"
        android:orientation="vertical" >

/* Some textviews, imageviews etc */

    </RelativeLayout>

</RelativeLayout>

When this pop-up is added, if it overlays some other views (e.g. button), when clicked on some area of the pop-up (e.g. textview), the underlying view is getting the event (button is clicked, edittext is popping up the keyboard and getting focused).

Is there anyway to avoid it?

È stato utile?

Soluzione

You can make the outer most ViewGroup clickable and addandroid:soundEffectsEnabled="false" to disable the click sound.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top