Find preceding element in appium


Hi have layout in android app like this

(2)TextView:1 [ id :conversations_row_message_count]
(2)TextView:2nd_place_medal:[ id :conversations_row_message_count]

I want to get preceding Text Views from the relative layout in which Text View with id " conversations_row_message_count " is present.
Below are the ways I have tried till now but nothing seems working for me

1. “//android.widget.TextView[contains(@resource-id,‘conversations_row_message_count’)]”;
**Resut : ** It gave me all the elements where TextView with id “conversations_row_message_count”.

**Resut : ** It gave me no element as there are not following element

**Resut : ** It gave me all the elements with their but when I tried to print it’s class name attribute it throws error “An element could not be located on the page using the given search parameters.”

**Resut : ** Tried to get preceding element but dint get any element.

Please suggest where I am going wrong