samedi 23 mai 2015

Click Event of View Inside Framelayout

I have Following layout Scenario

enter image description here

Want to implement the Click even of TextView ..but the TextView Click not working

Here is code Sample

 <FrameLayout
        android:id="@+id/frame"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerInParent="true" 
        android:clickable="false">

        <customview
            android:id="@+id/custom"
            android:layout_width="200dp"
            android:layout_height="200dp" 
            android:clickable="false"/>

        <LinearLayout
            android:id="@+id/abc"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/btn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/zero_done"
                android:padding="5dp"
                android:clickable="true"
                 android:textAppearance="?android:attr/textAppearanceMedium"
                android:textStyle="bold" />



        </LinearLayout>

My TextView ClickEvent not working ...please help me

Class Code

TextView view= (TextView) findViewById(R.id.btn);

        view.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub

                Toast.makeText(getApplicationContext(), "Press",
                        Toast.LENGTH_SHORT).show();
            }
        });

Aucun commentaire:

Enregistrer un commentaire