2017-11-19 1 views
0

Recyclerview에는 cardlayout text1, text2 (id) 두 개의 textviews.i가 포함되어 있습니다. 텍스트 1 문자열 값을 가져오고 싶습니다. 하나의 카드를 터치했습니다. (touchlistner). 텍스트 1 문자열을 인쇄하는 방법. 일했다.recyclerview 내부에서 textview 문자열을 얻는 방법

+0

시도한 코드를 추가 하시겠습니까? –

답변

2

recyclerView 목록 항목이 이고 위치가 인 경우 당신은

TextView text1 = yourRecyclerView.findViewHolderForAdapterPosition(position).itemView.findViewById(R.id.text1); 

와보기를 찾은 다음 textView 문자열을 얻을 수 있습니다.

String text1Str = text1.getText().toString(); 
System.out.println("my textView string : " + text1Str); 
+0

그것은 작동합니다. 당신을 감사드립니다. 기쁜 마음으로 –

+0

. 천만에요 – fthopkins

관련 문제