package zero.zd.zquestionnaire;

import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import java.io.File;

public class MainActivity extends AppCompatActivity {

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

        // create a folder
        File folder = new File(Environment.getExternalStorageDirectory().getPath() + "/ZQuestionnaire/");
        if (!folder.exists()) folder.mkdirs();
    }

    public void onClickAnswer(View view) {
        startActivity(LoadQnaActivity.getStartIntent(MainActivity.this));
    }

    public void onClickBuilder(View view) {
        startActivity(QnaBuilderActivity.getStartIntent(MainActivity.this));
    }

}

@@ -132,16 +132,41 @@
 tivity;%0A
+import android.util.Log;%0A
 import a
@@ -261,16 +261,91 @@
 vity %7B%0A%0A
+    private static final String TAG = MainActivity.class.getSimpleName();%0A%0A
     @Ove
@@ -667,24 +667,128 @@
 ()) 
-folder.mkdirs();
+%7B%0A            if (!folder.mkdirs()) %7B%0A                Log.e(TAG, %22Failed on creating folders.%22);%0A            %7D%0A        %7D
 %0A   

Add Logs on Filed Creation of Folders