title: is there any issue about WeakReference on Android?
body: <p>i want to transfer an Object throw intent ,
  but the object doesn't implements Serializable or parcelable.
  so i realize it like this:</p>
  
  <pre><code>private static Map&lt;String, WeakReference&lt;Object&gt;&gt; map = new HashMap&lt;String, WeakReference&lt;Object&gt;&gt;();
  
  public static void saveObjectInIntent(Intent intent, String key,
          Object value) {
      String realKey = randomString();
      map.put(realKey, new WeakReference&lt;Object&gt;(value));
      if (intent != null) {
          intent.putExtra(key, realKey);
      }
  }
  
  public static Object getObjectFromIntent(Intent intent, String key) {
      String realKey = intent.getStringExtra(key);
      WeakReference&lt;Object&gt; weak = map.get(realKey);
      if (weak != null) {
          return weak.get();
      }
      return null;
  }
  </code></pre>
  
  <p>but i found that even though the activity is finished, the object in weakreference is not recycled by gc.</p>
  
  <p>so i write a test like that:</p>
  
  <pre><code>Object obj = new Object();
  ObjectTrsnferHelper.saveObjectInIntent(null, "a", obj);
  obj = null;
  </code></pre>
  
  <p>the obj is not recycled either.</p>
  
  <p>why ?</p>
  
  <hr>
  
  <p>sorry, there is no probleam.
  but i wrote my test code wrong before.</p>
  
  <p>it should be :</p>
  
  <pre><code>Set&lt;String&gt; keys = map.keySet();
  for (String key : keys) {
      WeakReference&lt;Object&gt; weak = map.get(key);
      if (weak.get() == null) {
          App.log(key + "被清除了");
      }
  }
  </code></pre>
  
  <p>i wrote "if(weak==null)" before.</p>