title: How can I get hour/minute from TimePicker
body: <p>I have a layout where I placed a TimePicker and two buttons for select time:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  
      &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:orientation="vertical"
          &gt;
      &lt;TimePicker android:id="@+id/time_picker"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
          /&gt;
      &lt;LinearLayout android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:orientation="horizontal"
          &gt;
      &lt;Button android:id="@+id/time_picker_ok"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:text="@string/yes"
              android:onClick="set"/&gt;
      &lt;Button android:id="@+id/time_picker_cancel"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:text="@string/no"
              android:onClick="cancel"/&gt;
      &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I call it through method from another activity:</p>
  
  <pre><code>public void showPicker(View view) {
      LayoutInflater li = LayoutInflater.from(this);
      View dialogView = li.inflate(R.layout.time_picker, null);
      dialogView = new TimePicker(this);
  
      AlertDialog.Builder builder = new AlertDialog.Builder(this);
      builder.setTitle(R.string.time_start_label);
      builder.setView(dialogView);
  
      ad = builder.create();
      ad.show();
  }
  </code></pre>
  
  <p>And I have a handler for "yes" button:</p>
  
  <pre><code>public void set(View view) {
      LayoutInflater li = LayoutInflater.from(this);
      LinearLayout ll = (LinearLayout) li.inflate(R.layout.time_picker, null);
      TimePicker tp = (TimePicker) ll.findViewById(R.id.time_picker);
      int hour = tp.getCurrentHour();
      int minute = tp.getCurrentMinute();
  
      Utils.showMessage(this, hour + " " + minute); // Toast message
  }
  </code></pre>
  
  <p>But when I click on @+id/time_picker_ok I get a current system time instead of a selected time.</p>
  
  <p>How can I get selected time?</p>