Here's my xml using a LinearLayout. Both the Toolbar and the Button are at the top of the screen. However I want the Button centrally horizontal and centrally vertical. Also the Button is floated to the left and not in the center.
xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorVeryDark"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar" />
<Button
android:id="@+id/button2"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="text"
android:textSize="22dp"
android:layout_gravity="center_vertical"
android:background="@color/colorPrimaryDark"
/>
</LinearLayout>
How would I do this?