title: Android AsyncTask, getting SharedPreferences, stuck
body: <p>I'm stuck with a problem that seems very easy.. I've seen lot of threads concerning my problem, but none of them helped me. It's about getting Shared Prefferences..</p>
  
  <p>The thing is I want to get result from calculations in <code>doInBackground</code> method, but I just don't know how to use method <code>getSharedPreferences</code>. </p>
  
  <p>I have my main activity called <code>MainActivity</code>. I also created new <code>Java Class</code> that should do something in the background. Here's the code:</p>
  
  <pre><code>package com.example.pablo.zad3;
  
  import android.content.SharedPreferences;
  import android.os.AsyncTask;
  
  public class Background extends AsyncTask&lt;Integer,Void,String&gt;{
  
      @Override
      protected String doInBackground(Integer... params) {
          Integer n = params[0];
          StringBuilder sb=new StringBuilder();
         for(int i=1;i&lt;250;i++)
         {
             sb.append(i+ " ");
             sb.append(n*i+"\n");
         }
          return sb.toString();
      }
  
      @Override
      protected void onPostExecute(String s) {
          super.onPostExecute(s);
  
          SharedPreferences prefs = //WHAT NOW??
      }
  }
  </code></pre>
  
  <p>Yet, there's clearly something I don't understand, cause I don't know how to use it. Please provide me with some example code that would work in my case.</p>