Data Binding in an Activity with a MapFragment
<p>I would like to use <a href="https://developer.android.com/topic/libraries/data-binding/index.html" rel="nofollow noreferrer">Data Binding Library</a> in one of my projects but I am getting an error in the activity who has a MapFragment. Not using data binding librery the code works perfectly</p>

<p>My xml main_activity file:</p>

<pre><code>&lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"&gt;

    &lt;RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"&gt;

        &lt;android.support.v7.widget.Toolbar
            android:id="@+id/my_toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            android:elevation="4dp"
            android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /&gt;

        &lt;fragment
            android:id="@+id/map"
            android:name="com.google.android.gms.maps.SupportMapFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:context="com.project.activities.MainActivity" /&gt;

    &lt;/RelativeLayout&gt;

&lt;/layout&gt;
</code></pre>

<p>And the baseActivity related</p>

<pre><code>   public abstract class BaseActivity extends AppCompatActivity  {

        private ActivityMainBinding binding;
        private Toolbar toolbar;

        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            binding = DataBindingUtil.setContentView(this, getContentView());
            setContentView(getContentView());//Crashes
            getPresenter();
            configureToolbar();
            Log.d(Constans.LOG_TAG,"On create");
        }

        private void configureToolbar() {

            toolbar = binding.myToolbar;
            if (toolbar != null) {
                setSupportActionBar(toolbar);
                getSupportActionBar().setDisplayHomeAsUpEnabled(true);
            }

        }


        @Override
        protected void onStop() {
            super.onStop();
            Log.d(Constans.LOG_TAG,"On Stop");

        }

        @Override
        protected void onResume() {
            super.onResume();
            Log.d(Constans.LOG_TAG,"On resume");

        }

        @Override
        public boolean onCreateOptionsMenu(Menu menu) {
            return super.onCreateOptionsMenu(menu);


        }

        protected abstract int getContentView();
        protected abstract void getPresenter();

}
</code></pre>

<p>And the error I get is :</p>

<blockquote>
  <p>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.project.activities.MainActivity}: android.view.InflateException: Binary XML file line #18: Binary XML file line #18: Error inflating class fragment
                                                                                                   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2450)
                                                                                                   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
                                                                                                   at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                                                   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)
                                                                                                   at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                                   at android.os.Looper.loop(Looper.java:148)
                                                                                                   at android.app.ActivityThread.main(ActivityThread.java:5461)
                                                                                                   at java.lang.reflect.Method.invoke(Native Method)
                                                                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                                                Caused by: android.view.InflateException: Binary XML file line #18: Binary XML file line #18: Error inflating class fragment
                                                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
                                                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
                                                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
                                                                                                   at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
                                                                                                   at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
                                                                                                   at com.project.activities.MainActivity.BaseActivity.onCreate(BaseActivity.java:21)
                                                                                                   at android.app.Activity.performCreate(Activity.java:6251)
                                                                                                   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
                                                                                                   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2403)
                                                                                                   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510) 
                                                                                                   at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                                                   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363) 
                                                                                                   at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                                   at android.os.Looper.loop(Looper.java:148) 
                                                                                                   at android.app.ActivityThread.main(ActivityThread.java:5461) 
                                                                                                   at java.lang.reflect.Method.invoke(Native Method)</p>
</blockquote>

<p>The error itself is on <em>onCreate(Bundle savedInstanceState)</em> method on </p>

<blockquote>
  <p>setContentView(getContentView());</p>
</blockquote>

<p>What I am doing wrong?</p>