passing an array in intent android

前端 未结 2 1104
孤独总比滥情好
孤独总比滥情好 2021-01-14 13:46

So I\'ve always been under the assumption that you can\'t pass arrays between activities with extras. But I was just going through the Bundle class docs and saw putStr

相关标签:
2条回答
  • 2021-01-14 14:44

    You can pass any Serializable object as extra, so I don't see why you could not pass String array. There is a setExtra(String, Serializable) method in the Intent, that's what I use.

    0 讨论(0)
  • 2021-01-14 14:48

    I think you must be able to pass string[] as a bundle in Android. Any specific reason you have for getting into such a conclusion?

    Refer to this post

    http://www.anddev.org/view-layout-resource-problems-f27/how-can-i-pass-multidimensional-string-array-two-activities-t9259.html

    0 讨论(0)
提交回复
热议问题