package com.tehmou.rxbookapp;

import com.tehmou.rxbookapp.data.DataLayer;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;


public class MainActivity extends ActionBarActivity {

    private static final String TAG = MainActivity.class.getSimpleName();

    private DataLayer dataLayer;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        dataLayer = new DataLayer(getContentResolver());
        setContentView(R.layout.activity_main);
        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.container, new RepositoriesFragment())
                    .commit();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    public DataLayer getDataLayer() {
        return dataLayer;
    }
}

@@ -256,17 +256,16 @@
 ivity %7B%0A
-%0A
     priv
@@ -335,42 +335,8 @@
 );%0A%0A
-    private DataLayer dataLayer;%0A%0A
     
@@ -398,24 +398,24 @@
 nceState) %7B%0A
+
         supe
@@ -450,65 +450,8 @@
 e);%0A
-        dataLayer = new DataLayer(getContentResolver());%0A
     
@@ -1398,78 +1398,7 @@
    %7D
-%0A%0A    public DataLayer getDataLayer() %7B%0A        return dataLayer;%0A    %7D
 %0A%7D%0A

Remove dataLayer creation from MainActivity as redundant