开发者

How to send an ArrayAdapter to a ListActivity

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜