title: java - how to hold time?
body: <p>I'm building a little android app where the user would choose a start time for some operation.</p>
  
  <p>I'm using the TimerPickerDialog:</p>
  
  <pre><code>mTimePicker = new TimePickerDialog(getContext(), new TimePickerDialog.OnTimeSetListener() {
      @Override
      public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
          startTimeHours = selectedHour;
          startTimeMinutes = selectedMinute;
  }, hour, minute, is24hours);
  </code></pre>
  
  <p>and when a time is selected it returns an int for the hour and int for the minutes, which I save as a global variable.</p>
  
  <p>later in my app I want to convert those numbers into a Time object which I can then use to see if the current time is bigger or smaller than the time represented in that class.</p>
  
  <p>what I've done is this:</p>
  
  <pre><code>Time tStart = new Time(startTimeHours, startTimeMinutes, 0);
  </code></pre>
  
  <p>but eclips says that this constructor is deprecated. however the constructor that takes long is does not seem to be deprecated.</p>
  
  <p>I looked around and in one post someone recommended to use the Calendar object - but I couldn't figure it out - how to get a new instance of it and set my time. it looks like an overhead for just containing the time.</p>
  
  <p>What is the best practice for such a scenario? if I need to use the constructor that accepts the long variable - how do I convert my 2 integers to that long value?</p>