title: How can I do fragment injection on ToggleAccessibilityServicePreferenceFragment?
body: <p>I am trying to use fragment injection on android to invoke <em>com.android.settings.accessibility.ToggleAccessibilityServicePreferenceFragment</em> of my app's Accessibility Service. </p>
  
  <p>Here is the code: </p>
  
  <pre><code>Intent i = new Intent();
  i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
  i.setClassName("com.android.settings", "com.android.settings.Settings");
  ComponentName name = new ComponentName(getApplicationContext().getPackageName(), "MyAccessibilityService");
  i.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, "com.android.settings.accessibility.ToggleAccessibilityServicePreferenceFragment");
  i.putExtra("mComponentName", name);
  startActivity(intentTT);
  </code></pre>
  
  <p>But after executing those code, the LogCat showed this :</p>
  
  <pre><code>E/Settings:###(9542): onApplyThemeResource...
  E/HtcPreferenceActivity(9542): context.getClassLoader(): dalvik.system.PathClassLoader[/system/app/Settings.apk]
  E/HtcPreferenceActivity(9542): context.getPackageName(): com.android.settings
  E/HtcPreferenceActivity(9542): context.getPackageCodePath(): /system/app/Settings.apk
  E/HtcPreferenceActivity(9542): context.getPackageResourcePath(): /system/app/Settings.apk
  E/HtcPreferenceActivity(9542): fragmentName: com.android.settings.accessibility.ToggleAccessibilityServicePreferenceFragment
  E/AndroidRuntime(9542): FATAL EXCEPTION: main
  E/AndroidRuntime(9542): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.Settings}: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.android.settings.accessibility.ToggleAccessibilityServicePreferenceFragment: make sure class name exists, is public, and has an empty constructor that is public
  </code></pre>
  
  <p>I tried to invoke this fragment with "nComponentName" extra set to my app and then go to the accessibility service page of my app.</p>
  
  <p>Here is the part of android source code :</p>
  
  <pre><code>public class ToggleAccessibilityServicePreferenceFragment
              extends ToggleFeaturePreferenceFragment implements DialogInterface.OnClickListener {
          private static final int DIALOG_ID_ENABLE_WARNING = 1;
          private static final int DIALOG_ID_DISABLE_WARNING = 2;
          private final SettingsContentObserver mSettingsContentObserver =
              new SettingsContentObserver(new Handler()) {
                  @Override
                      public void onChange(boolean selfChange, Uri uri) {
                          String settingValue = Settings.Secure.getString(getContentResolver(),
                                  Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
                          final boolean enabled = settingValue.contains(mComponentName.flattenToString());
                          mToggleSwitch.setCheckedInternal(enabled);
                      }
                  };
          private ComponentName mComponentName;
          private int mShownDialogId; 
  </code></pre>
  
  <p>or you can go to this page of source code to see : <a href="https://goo.gl/c4UGw9" rel="nofollow">https://goo.gl/c4UGw9</a></p>
  
  <p>Is there any <code>other extras</code> that I need to set/put ? I am trying to fix the problem for over one month. But still can't solve it. Is there anything I missed ?</p>