@@ -954,8 +954,8 @@ private void writeMainActivity(final File srcDirectory, String[] permissions) {
954954 // More on permission in Android 23:
955955 // https://inthecheesefactory.com/blog/things-you-need-to-know-about-android-m-permission-developer-edition/en
956956 writer .println (" @Override" );
957- writer .println (" public void onResume () {" );
958- writer .println (" super.onResume ();" );
957+ writer .println (" public void onStart () {" );
958+ writer .println (" super.onStart ();" );
959959 writer .println (" ArrayList<String> needed = new ArrayList<String>();" );
960960 writer .println (" int check;" );
961961 writer .println (" boolean danger = false;" );
@@ -990,11 +990,12 @@ private void writeMainActivity(final File srcDirectory, String[] permissions) {
990990 writer .println (" builder.setMessage(\" The app cannot run without these permissions, will quit now.\" )" );
991991 writer .println (" .setCancelable(false)" );
992992 writer .println (" .setPositiveButton(\" OK\" , new DialogInterface.OnClickListener() {" );
993- writer .println (" public void onClick(DialogInterface dialog, int id) {}" );
993+ writer .println (" public void onClick(DialogInterface dialog, int id) {" );
994+ writer .println (" finish();" );
995+ writer .println (" }" );
994996 writer .println (" });" );
995997 writer .println (" AlertDialog alert = builder.create();" );
996998 writer .println (" alert.show();" );
997- writer .println (" finishAffinity();" );
998999 writer .println (" }" );
9991000 writer .println (" }" );
10001001 writer .println (" fragment.onPermissionsGranted();" );
0 commit comments