Sorry for the delay, it's been a long week!
Pertinent code from R.java:
public static final class id {
public static final int hour=0x7f050008;
public static final int mins=0x7f050009;
Pertinent code from timeactivity.java (thanks to kankan for the wheel
code - GREAT stuff):
public class TimeActivity extends Activity {
// Time changed flag
private boolean timeChanged = false;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.time_layout);
final WheelView hours = (WheelView) findViewById(R.id.hour);
hours.setAdapter(new NumericWheelAdapter(0, 23));
hours.setLabel("hours");
final WheelView mins = (WheelView) findViewById(R.id.mins);
mins.setAdapter(new NumericWheelAdapter(0, 59, "%02d"));
mins.setLabel("mins");
mins.setCyclic(true);
// set current time
Calendar c = Calendar.getInstance();
int curHours = c.get(Calendar.HOUR_OF_DAY);
int curMinutes = c.get(Calendar.MINUTE);
hours.setCurrentItem(curHours);
mins.setCurrentItem(curMinutes);
// add listeners
addChangingListener(mins, "min");
addChangingListener(hours, "hour");
OnWheelChangedListener wheelListener = new
OnWheelChangedListener() {
public void onChanged(WheelView wheel, int oldValue,
int newValue)
{
timeChanged = true;
timeChanged = false;
}
};
hours.addChangingListener(wheelListener);
mins.addChangingListener(wheelListener);
/**
* Adds changing listener for wheel that updates the wheel label
* @param wheel the wheel
* @param label the wheel label
*/
private void addChangingListener(final WheelView wheel, final
String label) {
wheel.addChangingListener(new OnWheelChangedListener() {
public void onChanged(WheelView wheel, int oldValue,
int newValue)
{
wheel.setLabel(newValue != 1 ? label + "s" :
label);
}
});
}
Wanted/needed: A way to call the R.id.hour and R.id.mins from a
different activity as the "set clock" time for my countdown timer.
Thank you for helping a newbie out!!
--
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