리스트뷰 아이템에 버튼을 가지고 있으면 focusable:"false"이걸주라길래 2개의 버튼에 다 그렇게 줬는데!
리스트뷰 아이템 클릭이 안되요 ㅠㅠ 버튼 클릭리스너는 어댑터뷰에서 설정했구요!
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:descendantFocusability="blocksDescendants"
android:layout_height="match_parent"
android:weightSum="1">
<RelativeLayout
android:descendantFocusability="blocksDescendants"
android:id="@+id/listlayout"
android:clickable="true"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="85dp">
<Button
android:id="@+id/progressend"
android:text="end"
android:focusableInTouchMode="false"
android:focusable="false"
android:clickable="false"
android:background="@drawable/shape"
android:textColor="@color/colorPrimary"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_alignTop="@+id/progressgo"
android:layout_toRightOf="@+id/progressgo"
android:layout_toEndOf="@+id/progressgo" />
<Button
android:text="confirm"
android:focusableInTouchMode="false"
android:focusable="false"
android:clickable="false"
android:id="@+id/progressgo"
android:background="@drawable/shape_ok"
android:textColor="@color/white"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/linearLayout"
android:layout_toRightOf="@+id/linearLayout"
android:layout_toEndOf="@+id/linearLayout" />
<ProgressBar
android:progressDrawable="@drawable/progressbar_custom"
android:layout_marginTop="15dp"
android:layout_marginLeft="60dp"
android:layout_marginRight="10dp"
android:max="100"
android:id="@+id/progressbar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="10dp"
android:layout_below="@+id/linearLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
</LinearLayout>
fragment 탭에서 이런식으로 다른 프래그먼트에도 잘 붙었던 리스너 고대로 가져왔는데 안먹히네요 ㅠㅠ 뭐가 문제일까요
mListView = (ListView) view.findViewById(R.id.list);
mListView.setEmptyView(view.findViewById(R.id.emptyView));
dbmanager = new DBManager(getActivity());
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
Toast.makeText(getView().getContext(), "리스트뷰 클릭리스너",
Toast.LENGTH_SHORT).show();
Context mContext = getActivity();
cursor.moveToPosition(position);
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(getActivity().LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.tab2_dialog, null);
TextView text = (TextView) layout.findViewById(R.id.dialog_name);
TextView date = (TextView) layout.findViewById(R.id.dialog_date);
TextView step = (TextView) layout.findViewById(R.id.dialog_step); (생략)