title: Android load SharedPreferences for widget into Preference Activity
body: <p>i am able to link an shared preference to an activity that way: </p>
  
  <pre><code> Intent intent = getIntent();
   Bundle extras = intent.getExtras();
   if (extras != null) appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,
                                                   AppWidgetManager.INVALID_APPWIDGET_ID);
  
   if (appWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) finish();
  
   SharedPreferences pref = getSharedPreferences("Widget"+appWidgetId, 0);
  </code></pre>
  
  <p>In the configuration dialog of my preference application I can access the displayed preferences via: </p>
  
  <pre><code> getPreferenceScreen().getSharedPreferences();
  </code></pre>
  
  <p>These preferences are not linked to a widget but global. How can I change the preferences that are displayed in my preference activity to the widget aligned preferences?</p>
  
  <p>I tried to set the shared preference file manually: </p>
  
  <pre><code>  PreferenceManager localPrefs = getPreferenceManager();
    localPrefs.setSharedPreferencesName("GITC_Prefs"); 
  </code></pre>
  
  <p>This leads to a null pointer exception when I try to access the shared Preferences via</p>
  
  <pre><code> PreferenceActivity.getPreferenceScreen();
  </code></pre>