Android getWindow to set the background of my activity according to Listpreference
<p>I've basically created a ListPreference where user would be able to choose from a list of options. After they have chosen one of the available option,the app will return to the main activity and the background image will change accordingly,however,it seems my app would't be able to detect the change in preference and change the background image.Can somebody please advice?Thanks!***Below snippet shows after my main activity resume,how it detects the change in preference and change the background image.</p>

<pre><code>protected void onResume() 
{
    super.onResume();
    listener = new SharedPreferences.OnSharedPreferenceChangeListener() {
          public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
              if(key.equals("listPrefwall")){
                tv.setText(prefs.getString("listPrefwall", "ondon"));   


                    if(prefs.getString("listPrefwall", "ondon")=="ondon")
                    {
                        getWindow().setBackgroundDrawableResource(R.drawable.ondon);
                        tv.setText("testing");
                    }
                     else if(prefs.getString("listPrefwall", "ondon")=="japan")
                     {
                         getWindow().setBackgroundDrawableResource(R.drawable.japan);
                         tv.setText("pivot");
                      }
        }
          }
        };
    settings.registerOnSharedPreferenceChangeListener((OnSharedPreferenceChangeListener) listener);

}
</code></pre>
