title: Android Preferences activity change before function ends
body: <p>I want to change the visualization of preferences activity before the method ends to show a message or progressbar.</p>
  
  <pre><code>buttonSave.setOnPreferenceClickListener(new OnPreferenceClickListener() {
              public boolean onPreferenceClick(Preference preference) {  
                  buttonSave.setTitle(getString(R.string.loadingWait));//visualization to change before the next function ends
                  back();//this function takes a long time      
               //   buttonSave.setTitle(getString(R.string.bSave));
                  return true;
              }
      });
  </code></pre>
  
  <p>How Can I do that? Other possibility is shows a progressbar, but I can show it before the function back() ends.</p>
  
  <p>Many thanks in advance</p>