Sunday, September 4, 2011

[android-developers] How I can add an int to an array if the user clicks a button?

I want to make a program, which will has a lot of buttons. If the user
clicks one button, I want to add a specified number (int) to an array.

int[] array;

array = new int[20];

button.setOnClickListener(new View.OnClickOnListener) {

@Override
public void onClick (View v) {
//something to add the button's specified number to the
array
}

}

What I need to write to the method to add the number to the array? Is
there a method for this?

If I can make this, I will want to see whether my array and the user's
array is equals or not. Can I do this with the normal equals(myarray,
usersarray) ?

Thanks for any helps!

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate