I'm Creating a Alarm based Application with API version 23. But TimePicker getCurrentMinute,getCurrentHour method is Deprecated. Which method will be replace of this method ?
EDIT:
According to google documentation now we have to use getMinute() and getHour() method. But it's only working in api 23. what we have to do for other api?
Just check the Android official docs .. http://developer.android.com/reference/android/widget/TimePicker.html
it tells you everything
public Integer getCurrentMinute () Added in API level 1 This method was deprecated in API level 23. Use getMinute() Returns the current minute
and
public Integer getCurrentHour () Added in API level 1 This method was deprecated in API level 23. Use getHour() Returns the current hour in the range (0-23)
Android offers runtime checks for API version. Most of the time in such cases, you'll want to run cases like
if (Build.VERSION.SDK_INT >= 23 ) myTimePickerView.getHour(); else myTimePickerView.getCurrentHour();
@see http://developer.android.com/reference/android/os/Build.VERSION.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With