I will refer to one of my earlier answers which you can use to get you a view at the index of a list here.
Once you have this you can combine the function with a new one that get all the child elements of a view:
private List<View> getAllChildren(View v) {
if (!(v instanceof ViewGroup)) {
ArrayList<View> viewArrayList = new ArrayList<View>();
viewArrayList.add(v);
return viewArrayList;
}
ArrayList<View> result = new ArrayList<View>();
ViewGroup viewGroup = (ViewGroup) v;
for (int i = 0; i < viewGroup.getChildCount(); i++) {
View child = viewGroup.getChildAt(i);
ArrayList<View> viewArrayList = new ArrayList<View>();
viewArrayList.add(v);
viewArrayList.addAll(getAllChildren(child));
result.addAll(viewArrayList);
}
return result;
}
and then finally the last one is to filter a list of views by id
public View(List<View> views, int idToMatch) {
for (View view : views) {
if (view.getId() == idToMatch) {
return view;
}
}
return null;
}
You can probably figure out hwo to combine these all into one function that will do what you want nicely. (Hint an R.id.price is an integer so just pass that into the last functon once you have th elist of children at the index you wanted to get)