0

I have a method called getData() in an Activity that returns a String[]:

Example:

public class Strings{
    public String[] getData(){
    String[] data = {"one","two","three"};
    return data;
    }
}

My question is how to retrieve these items, because in another activity I want to put this into a SimpleAdapter list. I can call

String[] data = Strings.getData();

then have that as a variable that is technically the array, but I need to read out the items into the adapter. I know its probably simple but like I said, noob, haha.

Bob
  • 1,088
  • 1
  • 9
  • 15
  • 1
    http://stackoverflow.com/questions/6355787/how-to-pass-arraylist-from-one-activity-to-another and herehttp://stackoverflow.com/questions/3597974/passing-an-array-in-intent-android – Sergey Benner Feb 26 '12 at 03:14

1 Answers1

0

For sharing data between different activity, I think you need to send that data with Intent before you change Activity

intent.putExtra("TheStrings", this.getStrings());
Simon Wang
  • 2,843
  • 1
  • 16
  • 32