This is my new updated code, it prints out blank input in the
array...so why is it not storing my user input?
public class Screen2 extends Activity {
EditText txt1;
String player;
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){
if (txt1.getText().toString().length() !=0){
playerList.add(player);
}
System.out.println(playerList.toString());
}
});
On Feb 28, 12:54 pm, TreKing <[email protected]> wrote:
> On Tue, Feb 28, 2012 at 11:46 AM, minnie me <[email protected]> wrote:
> > It doesn't store array and allow me to display it on click
>
> That's still quite ambiguous. Read the link I gave you, then please try
> again, with more detail. Explain what you are doing. Pretend we have no
> knowledge of your problem since, you know, we don't.
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en