title: onactivityResult get called at the wrong time
body: <p>I'm using this code</p>
  
  <pre><code>      final Intent i = new Intent();
        i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
        i.addCategory(Intent.CATEGORY_DEFAULT);
        i.setData(Uri.parse("package:" + context.getPackageName()));
        i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
        i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
        parentFragment.startActivityForResult(i, Constants.PERMISSIONS);
  </code></pre>
  
  <p>to let the user the option to change settings in run time. this code occurs when the user is clicking on a button. 
  what I'm trying to do is to get the information of his choice, for this I'm using <strong>onActivityResult</strong> method. But I noticed that this method is getting called when the user is clicked on the button and entered to the settings screen.</p>
  
  <p><strong>This code is found in Fragment and not in Activity.</strong></p>