This commit is contained in:
hyb1996
2017-12-30 17:34:19 +08:00
parent 05877c57b7
commit efb3054084

View File

@@ -32,15 +32,17 @@ public class IntentExtras implements Serializable {
} }
private Map<String, Object> mMap; private Map<String, Object> mMap;
private int mId;
private IntentExtras() { private IntentExtras() {
mMap = new HashMap<>(); mMap = new HashMap<>();
int id = mMaxId.incrementAndGet(); mId = mMaxId.incrementAndGet();
extraStore.put(id, mMap); extraStore.put(mId, mMap);
} }
private IntentExtras(int id) { private IntentExtras(int id) {
mId = id;
mMap = extraStore.get(id); mMap = extraStore.get(id);
if (mMap == null) { if (mMap == null) {
mMap = new HashMap<>(); mMap = new HashMap<>();
@@ -60,7 +62,7 @@ public class IntentExtras implements Serializable {
} }
public Intent putInIntent(Intent intent) { public Intent putInIntent(Intent intent) {
intent.putExtra(EXTRA_ID, mMaxId); intent.putExtra(EXTRA_ID, mId);
return intent; return intent;
} }
} }