I am writing a date picker activity that looks like a calendar. The
activity is basically a scrollable ListView of "MonthView" views I
have written which are in turn each a table of buttons representing
each day in the month. When a MonthView is instantiated I walk each
button in the view (defined in XML) and attach a click listener to
detect if a user has pressed the button representing each day:
b.setOnClickListener(new
OnClickListener()
{
@Override
public void onClick(View v) {
setSelectedDate(buttonDayClosure, b);
}
});
The setSelectedDate function does various things, including changing
the button background to yellow. In my emulator, everything works
fine. Create the datepicker, click on a day, the button turns
yellow. No problems. However, on a physical device (and a few peer
emulators) you can click on a date and nothing happens...until you
attempt to scroll the list view. So, for example, the date picker
activity appears on the screen. Press "3rd". Nothing happens. Jiggle
the list view a little by scrolling (without touching the 3rd button)
and all of a sudden the 3rd appears yellow.
On peer emulators I can set a breakpoint on the "setSelectedDate"
invocation and observe that the BP is only hit when a scroll "jiggle"
occurs (even though I am not attempting a scroll by touching the
button in question). So for example, I press the "3rd" button and the
BP is not hit. I can walk away, get a drink of water, come back, do a
tiny scroll on the list view and all of a sudden the BP is hit.
Any thoughts on why this might be the case?
--
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