title: How to replace old getCurrentHour() with new getHour()?
body: <p>I have these code and work well  to show time from timePicker. the code use getCurrentHour and  getCurrentMinute.</p>
  
  <pre><code>public void setTime(View view) {
      int hour = timePicker1.getCurrentHour();
      int min = timePicker1.getCurrentMinute();
      showTime(hour, min);
  }
  
  public void showTime(int hour, int min) {
      if (hour == 0) {
          hour += 12;
          format = "AM";
      }
      else if (hour == 12) {
          format = "PM";
      } else if (hour &gt; 12) {
          hour -= 12;
          format = "PM";
      } else {
          format = "AM";
      }
      time.setText(new StringBuilder().append(hour).append(" : ").append(min)
              .append(" ").append(format));
  }
  </code></pre>
  
  <p>The android Studio tell me to use new getHour() and getMinute() instead.</p>
  
  <p>when I use them in the code above the app stop and crash. why and how to use them correctly.</p>
  
  <p>This is the error in logcat:
   Caused by: java.lang.NoSuchMethodError: No virtual method getHour()I in class Landroid/widget/TimePicker; or its super classes (declaration of 'android.widget.TimePicker' appears in /system/framework/framework.jar:classes2.dex)</p>