How to find Android elements that have the same Resource-Id but different Indexs and Names

@Matt882 some updates:

  1. resourceId -> resourceIdMatches
new UiSelector().resourceIdMatches(\".*:id/people_form_recyclerview\")
  1. instead of “First Name” use variable
function WebElement getElementByText(String text)
return driver.findElement(MobileBy.AndroidUIAutomator(
            "new UiScrollable(new UiSelector().resourceIdMatches(\".*:id/people_form_recyclerview\")).getChildByText("
                    + "new UiSelector().resourceIdMatches(\".*:id/formElementValue\"), \"" + text + "\")"));