I want to get the position of an element in RecyclerViewfrom a dataset RecyclerView. Each item in my dataset contains a unique identifier . I want to find the position of the element’s adapter in RecyclerViewcorresponding to the identifier in the dataset.
My dataset class is as follows.
class dataset {
int id;
JSONArray linked;
int type;
....
}
I'm adding TextViewor EditTextin RecyclerViewaccording to the type.
Final goal: My RecyclerViewcan have several EditTextand TextViewswhich are independent (although it TextViewwill have a field that has an identifier EditTextit is associated with). When I click TextView, I will have an identifier EditText(dataset) to receive the data. I want to get the text from the corresponding EditTextfrom the element in RecyclerViewwith these identifiers. If I can get the adapter position from the dataset, I can somehow use
recyclerview.getChildAt(position);
But there is no way to get the adapter position from the dataset.
source
share