开发者

How to send an ArrayAdapter to a ListActivity

开发者 https://www.devze.com 2023-03-21 03:39 出处:网络
i would like to know how to send an ArrayAdapter that i\'m filling in one activity, to a ListActivi开发者_如何学Pythonty display it.

i would like to know how to send an ArrayAdapter that i'm filling in one activity, to a ListActivi开发者_如何学Pythonty display it.

The program itself searches for bluetooth devices around and fills the ArrayAdapter with it's names, then i would like to sent the created list to a ListActivity so the user can select one.

Thanks


Check this How do I pass data between Activities in Android application?. It will be better not to send the ArrayAdapter via Intent but to send only the data (ArrayList or even String[]) and then to construct the ArrayAdapter in the new Activity.


You can take a look at this which explains how to pass a int[] across activities through Intent.putExtra(). Another option is that you would make the data that you want accessible by the other activity as public static so the other activity could just access it freely.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号