How to fill a spinner with content?
guys I'm very new to the Java word, but i share part of the knowledge because of my c# backgroun开发者_运维技巧d, anyways i started developing for android and I'm running into a few snags like the following.
I usually program very OOP so i made all my objects and now i got a very common public class User
with things like:
public void setId(long id) {
this.id = id;
}
public long getId() {
return id;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getFirstName() {
return firstName;
}
and many other properties in it. Also i have a class UserHelper
where i have a populated array with all the users been pulled by the queries in the Helper
public ArrayList< User > getCurrentUsers() { return currentUsers; }
well... the thing is, i want to be able to populate a spinner with a the value returned from getFirstName as the Display and getId obviously as the Id. I know exactly how to do this in C# but i been trying to fight with Cursors and doing some reading around but nothing, so i figured that it would be an interesting question.
ANYONE CAN SHOW ME HOW TO DO IT PLEASE?
Hi Alex look this examples
http://developer.android.com/resources/tutorials/views/hello-spinner.html
http://mobiforge.com/designing/story/understanding-user-interface-android-part-3-more-views
精彩评论