这里我使用框架布局,当我点击,登录linearlayout被调用,这里当我尝试clikc OK按钮,我收到此警告,谁能说我怎么能使用OK按钮事件?... .......
**my lauyout is**
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_practitioner"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<ImageView
android:id="@+id/item_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:contentDescription="@string/contentDescriptionContent"
>
</ImageView>
<LinearLayout
android:id="@+id/layout_login"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="center"
android:background="#80000000"
android:visibility="gone"
android:gravity="center"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:text="@string/enter_pass_password"
android:paddingBottom="7dp"
android:textSize="20sp"
/>
<EditText
android:id="@+id/edit_practitioner_pin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/edittext_shape"
android:ems="6"
android:gravity="center"
android:inputType="numberPassword"
android:maxLength="4"
android:visibility="visible" >
</EditText>
<Button
android:id="@+id/pract_button"
android:layout_width="70dp"
android:layout_height="35dp"
android:background="@drawable/buton_shape"
android:gravity="center"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:text="OK"
android:layout_marginBottom="25dp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="bottom"
android:background="#bbffffff"
android:focusable="false"
android:focusableInTouchMode="false"
>
<TextView android:id="@+id/item_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:textColor="@color/text_black"
android:gravity="bottom|center"
android:textSize="25sp"
android:textAllCaps="true"
> </TextView>
<TextView
android:id="@+id/text_pratiotioner_group_name"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/sub_title_color"
android:visibility="visible"
android:gravity="bottom|center"
android:textAllCaps="true"
/>
</LinearLayout>
</FrameLayout>
我的java代码
holder.img_pract_view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
id_ = holder.img_pract_view.getId();
Log.d("*inside***id", ""+v.getId());
//holder.loginButton.setVisibility(View.VISIBLE);
//Toast.makeText(getApplicationContext(), "image clicked"+v.getId(), Toast.LENGTH_LONG).show();
holder.edit_pin.setText("");
holder.edit_pin.setInputType(InputType.TYPE_CLASS_NUMBER);
holder.edit_pin.setTransformationMethod(PasswordTransformationMethod.getInstance());
holder.loginLayout.setVisibility(View.VISIBLE);
}
});
holder.loginButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
holder.loginLayout.setVisibility(View.GONE);
Log.d("button", "clicked");
}
});
convertView.setTag(holder);
## Heading ##