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.
精彩评论