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);
    }
}

@@ -204,16 +204,73 @@
 vity %7B%0A%0A
+    private BackPressCloseHandler backPressCloseHandler;%0A
     @Ove
@@ -275,16 +275,16 @@
 verride%0A
-
     prot
@@ -428,12 +428,184 @@
 n);%0A
-    %7D
+%0A        backPressCloseHandler = new BackPressCloseHandler(this);%0A    %7D%0A%0A    @Override%0A    public void onBackPressed() %7B%0A        backPressCloseHandler.onBackPressed();%0A    %7D%0A%0A%0A%0A
 %0A%7D%0A

Edit MainActivity for BackPressCloseHandler Test