RecyclerView
Bağdaştırıcım var. Diğer RecyclerView
Adaptörlerim de var ve hiçbir sorun olmadan tıklanıyorlar. Ancak, RecyclerView
öğelerinden birini tıklattığımda, tost mesajı görünmüyor. Niye ya?RecyclerView Tıklanma Olmuyor
public class AttendanceAdapter extends RecyclerView.Adapter {
//...
//other overridden factory methods of RecyclerView Adapter and //Constructors and data setting Methods
//...
public class AttendanceListViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
TextView rollNo, name;
ImageView isPreset;
public AttendanceListViewHolder(View itemView) {
super(itemView);
itemView.setOnClickListener(this);
// ...
// Layout Items initialization
// ...
}
@Override
public void onClick(View v) {
Toast.makeText(mContext,"reyclerViewClicked",Toast.LENGTH_LONG).show();
}
}
}
DÜZENLEME:
Benim itemView XML şöyle ..
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:orientation="horizontal">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="10"
android:padding="5dp">
<TextView
android:id="@+id/roll_no_in_attendance_single_item"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="2"
android:textColor="@color/colorTeal"
android:textSize="18sp"
android:gravity="center"
android:fontFamily="sans-serif-condensed"
android:text="1" />
<TextView
android:id="@+id/name_in_attendance_single_item"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="6"
android:textColor="@color/colorTeal"
android:textSize="18sp"
android:gravity="center"
android:fontFamily="sans-serif-condensed"
android:text="1" />
<ImageView
android:layout_margin="10dp"
android:id="@+id/present_or_absent_toggle_in_attendance_single_item"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:src="@mipmap/ic_check_circle_black_24dp"
android:tint="@color/colorTeal"
android:layout_weight="2"
android:text="1" />
</LinearLayout>
</ScrollView>
</android.support.v7.widget.CardView>
itemview custome görünümüdür? o zaman lütfen öğe görünümünüzü gönderin xml code –
Her öğeyi scrollview'e yerleştirdiğim için teşekkür ettim, edit içinde itemView'i yayınladım, teşekkürler kardeşim günümü kurtardı :) – erluxman