Hi Pushpank,
please find the below piece of code which can help you to work with lists.
boolean bFlag = true;
while(bFlag){
List posts = getDriver().findElements(By.xpath("//android.widget.ListView/android.widget.RelativeLayout"));
if(posts.size()!=0){
for(int iCounter=0;iCounter<posts.size();iCounter++){
//Compare the with actual and expected contact names,Click on if its found in the list
if(posts.get(iCounter).findElement(By.id("conatctid"))).getText().equals("expected value")){
posts.get(iCounter).findElement(By.id("conatctid"))).click();
bFlag = false;
break;
}
}else{
getRep().report("Verify contacts available for user", 1, "Contacts not available for user", 0);
}
if(bFlag){
SwipeUp(0.60, 0.40, "Posts");
}
}
--Depends on requirement you can implement or change the code.