title: Android preference activity IllegalArgumentException: Invalid fragment for this activity
body: <p>I have a problem with my preference activity.
  I've created to preference screens and one preference activity.
  On my phone with Android 4.2.2 it works fine.
  But on Android Emulator with Android 5.0 it crashes with this error: <code>IllegalArgumentException: Invalid fragment for this activity.</code>
  Is this because of this code?:</p>
  
  <pre><code> @Override
      protected boolean isValidFragment(String fragmentName) {
          return MyPreferenceFragment.class.getName().equals(fragmentName);
      }
  </code></pre>
  
  <p>The second preference fragment would be MyExportPreferenceFragment...
  How can I use both of them with one activity?</p>
  
  <p>Thanks for your help</p>
  
  <p>//EDIT: Found a solution but maybe it's too hacky^^</p>
  
  <pre><code>@Override
      protected boolean isValidFragment(String fragmentName) {
          if(MyPreferenceFragment.class.getName().equals(fragmentName)) {
              return MyPreferenceFragment.class.getName().equals(fragmentName);
          }
          else {
              return MyExportPreferenceFragment.class.getName().equals(fragmentName);
          }
      }
  </code></pre>
  
  <p>Is this okay? Or is it dangerous to do it like that?</p>