title: How to access hashmap values from another class?
body: <p>I would like to access hashmap set of values created in main class from other class.I have followed the steps for it but I am only getting null value at the sub-class.Here is the code</p>
  
  <pre><code>public class SoapTester extends Activity {  
  private static final String TAG = "Test";  
  public HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      map.put("year", "Apple");
      map.put("make", "Mango");
      map.put("model", "Grape");
      map.put("style", "Orange");
      map.put("series", "Peach");
  }
  
  public HashMap&lt;String, String&gt; getHashmap() {
      Log.v(TAG, "map2: E" + map);
      return map;
  }
  
  public void setHashmap(HashMap&lt;String, String&gt; map) {
      this.map = map;
      getHashmap();
      Log.v(TAG, "map1: E" + map);
  }
  }
  </code></pre>
  
  <p>//Sub Class</p>
  
  <pre><code>public class Tradein extends Activity {
  private static final String TAG = "Test";
  
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.tradein);
      SoapTester ex = new SoapTester();
      HashMap&lt;String, String&gt; hm = ex.getHashmap();
      Log.v(TAG, "hm: " + hm);//Getting Null Value here
  }
  }
  </code></pre>
  
  <p>Have I missed anything?</p>