title: How can I get the parent of a view using uiautomator?
body: <p>I'm trying to identify the parent view of an ui element so I can navigate through the UI freely.</p>
  
  <p>For example, in Settings app, I can find the view with the text "Bluetooth":</p>
  
  <pre><code>UiObject btView = new UiObject(new UiSelector().text("Bluetooth"));
  </code></pre>
  
  <p>Now, the part where I get stuck is this one: I want to navigate two levels up and start a new search for the on/off button that enables and disables bluetooth.</p>
  
  <p>Note: I can get the button if I use the code below.</p>
  
  <pre><code>UiObject btButtonView = new UiObject(new UiSelector().className("android.widget.Switch").instance(1));
  </code></pre>
  
  <p>This searches for switch buttons and returns the second encounter. I want the search to be more precise and look for the button in the linear layout that contains the "Bluetooth" text.</p>
  
  <p>UPDATE:
  This is the layout of the Settings app (the Bluetooth part that I need):</p>
  
  <pre><code>LinearLayout
      LinearLayout
          ImageView
      RelativeLayout
          TextView (with text = "Bluetooth")
      Switch ()
  </code></pre>