(DO NOT MERGE) Fix sample SoftKeyboard preference activity

(cherry picked from Master, commit 8359ac20a5af85a67207ab543a70d240a2c56450)

Bug: 17887760
Change-Id: Ibe7d1f2b9189ecee7867a2448790eddb151bd61a
diff --git a/samples/SoftKeyboard/src/com/example/android/softkeyboard/ImePreferences.java b/samples/SoftKeyboard/src/com/example/android/softkeyboard/ImePreferences.java
index db6c1d9..14c67b7 100644
--- a/samples/SoftKeyboard/src/com/example/android/softkeyboard/ImePreferences.java
+++ b/samples/SoftKeyboard/src/com/example/android/softkeyboard/ImePreferences.java
@@ -41,6 +41,11 @@
         setTitle(R.string.settings_name);
     }
 
+    @Override
+    protected boolean isValidFragment(final String fragmentName) {
+        return Settings.class.getName().equals(fragmentName);
+    }
+
     public static class Settings extends InputMethodSettingsFragment {
         @Override
         public void onCreate(Bundle savedInstanceState) {