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; }
2.1m questions
2.1m answers
60 comments
57.0k users