While using Intent object we can put different types of data directly using its putExtra(). We can also put these extra data into a Bundle object and add it to Intent. So why do we need Bundle if we can do so using Intent directly?
putExtra()
Bundle
Intent
As you can see, the Intent internally stores it in a Bundle.
public Intent putExtra(String name, String value) { if (mExtras == null) { mExtras = new Bundle(); } mExtras.putString(name, value); return this; }
1.4m articles
1.4m replys
5 comments
57.0k users