title: NullPointerException when transferring variable between classes
body: <p><a href="http://pastebin.com/DxhgeRY9" rel="nofollow noreferrer"><code>MainActivity.java</code></a></p>
  
  <p>Now I'm trying to transfer a String from a Class to another, in this way:</p>
  
  <pre><code>//setting it public
  public String grid_columns;
  
  sp = getSharedPreferences(PREFS_NAME,0);
  
  //getting the String from a shared preference file
  //ignore that its a number, in the file its considering a string
          this.grid_columns = sp.getString("grid_columns", "3");
          Log.i("TAG",grid_columns);
          //menes.setGrid_columns(grid_columns);
  </code></pre>
  
  <p>Now in the other class, I need to get this string and Log it just to test.
  AdapterListView.java
  <a href="http://pastebin.com/NxfHjXjv" rel="nofollow noreferrer">http://pastebin.com/NxfHjXjv</a></p>
  
  <pre><code>//getting the String from the other activity
  MainActivity main = new MainActivity();
          String grid_columnsA = main.grid_columns;
  
          if(convertView == null){
  
              convertView = inflater.inflate(R.layout.item_list, null);
              Log.i("TAG",grid_columnsA);
  //NullPointerException in this line (Log.i...)
  </code></pre>
  
  <p>What am I doing wrong?
  I already tried getters and setters and NullPointerException again.</p>