Sunday, May 20, 2012
Home
News
Products
PERT Estimating Tool
SermonTrackr
Blog
Contact Us
Blog
Login
Register
Blog
Custom Objects and Android Spinners
By SuperUser Account on
10/28/2011 8:47 PM
Recently, I ran into an issue with SermonTrackr for Android that took me more than a few minutes to figure out. My task was to set the selection of the Spinner control to the ServiceType specified on the Service. I have a Spinner control that contains a list of ServiceType entities (inheriting BaseEntity). The signature of the BaseEntity and ServiceType are below:
1: @SuppressWarnings("serial") 2: public abstract class BaseEntity implements Serializable { 3: public int id; 4: } 5: 6: public class ServiceType extends BaseEntity { 7: public String serviceTypeName; 8: }
When the ServiceActivity loads, I needed to set the selected ServiceType on the Spinner. I had the id of the ServiceType, but that does not necessarily match the index of the items as they appear on the Spinner. In order to get the position of the selected item in the Spinner, I iterated through...
PermaLink
Read More »
Comments (0)
Thinking Outside the Box
Blog
Custom Objects and Android Spinners
Posted on: Saturday, October 29, 2011
Blog
There are no recent comments on this blog.
Blog
Archive
<
October 2011
>
Sun
Mon
Tue
Wed
Thu
Fri
Sat
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
Monthly
October, 2011 (1)
Go
Blog
Keywords
Phrase
Blog
View All Recent Entries
Thinking Outside the Box (0)
Blog
Blog
Copyright 2011 by Burris Consulting Group LLC
Terms Of Use
Privacy Statement