package org.zeropage.apps.zeropage.main;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import org.zeropage.apps.zeropage.R;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

package org.zeropage.apps.zeropage.main;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import org.zeropage.apps.zeropage.R;

public class MainActivity extends AppCompatActivity {

    private BackPressCloseHandler backPressCloseHandler;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        backPressCloseHandler = new BackPressCloseHandler(this);
    }

    @Override
    public void onBackPressed() {
        backPressCloseHandler.onBackPressed();
    }




}

Edit MainActivity for BackPressCloseHandler Test