title: How to properly center a set of buttons inside a Relative Layout?
body: <p>So I have the following code which works perfectly fine but Android Studio is complaining that the use a nested Relative Layout is redundant. My question is, what's the proper way to do this?</p>
  
  <p>NOTE: I want both/all the buttons centered as a whole. Not one centered button with other's relative to it </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"&gt;
  
     &lt;RelativeLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_centerInParent="true"
         android:padding="5dp"&gt;
  
     &lt;Button
         android:id="@+id/btnOpenRecyclerViewActivity"
         style="@style/MainActivityButton"
         android:text="Button 1" /&gt;
  
     &lt;Button
         android:id="@+id/btnOpenNormalNotificationActivity"
         style="@style/MainActivityButton"
         android:text="Button 2"
         android:layout_below="@id/btnOpenRecyclerViewActivity" /&gt;
  
     &lt;/RelativeLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/AFpvt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AFpvt.png" alt="enter image description here"></a></p>