I have this array in a page and i want to call it into a listview or textview in another page...how do i do that?
public class Screen2 extends Activity {
public static EditText txt1;
public static String player;
public static ArrayList<String> playerList = new ArrayList<String>();
/** Called when the activity is first created. **/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.screen2);
// edittext1 or textview1
txt1 = (EditText) findViewById(R.id.editText1);
player = txt1.getText().toString();
// add more items button
Button more = (Button) findViewById(R.id.button1);
more.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
player = txt1.getText().toString();
if (txt1.getText().toString().length() != 0) {
playerList.add(player);
txt1.setText("");
}
Toast.makeText(getBaseContext(),
"Players Added:" + playerList + " ",
Toast.LENGTH_SHORT).show();
}
});
I want to be able to call it in Screen ..help please