Advantages of using Bundle instead of direct Intent putExtra() in Android

后端 未结 4 1858
青春惊慌失措
青春惊慌失措 2020-11-29 18:10

In my android application I\'m always using direct putExtra() function of Intent class to pass any number of value to new Activity.

4条回答
  •  情话喂你
    2020-11-29 18:45

    Bundles are cool because you can isolate their creation/reading more easily, therefore separating the code handling the bundles from the code of the UI.

    In most case that's useless as you'll want to transmit the smallest possible amount of data (usually just a couple of strings, an id ...)

提交回复
热议问题