/** * @since Available in iOS 8.2 and later. */ public static NSObject observeUserPreferencesDidChange(HKHealthStore object, final VoidBlock1<HKHealthStore> block) { return NSNotificationCenter.getDefaultCenter().addObserver(UserPreferencesDidChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((HKHealthStore) a.getObject()); } }); } }
@Method(selector = "biologicalSexWithError:") private native HKBiologicalSexObject getBiologicalSex(NSError.NSErrorPtr error); public HKBloodTypeObject getBloodType() throws NSErrorException {
@Method(selector = "bloodTypeWithError:") private native HKBloodTypeObject getBloodType(NSError.NSErrorPtr error); @Method(selector = "isHealthDataAvailable")
@Method(selector = "dateOfBirthWithError:") private native NSDate getDateOfBirth(NSError.NSErrorPtr error); public HKBiologicalSexObject getBiologicalSex() throws NSErrorException {
/** * @since Available in iOS 8.0 and later. * @deprecated Deprecated in iOS 10.0. */ @Deprecated public NSDate getDateOfBirth() throws NSErrorException { NSError.NSErrorPtr ptr = new NSError.NSErrorPtr(); NSDate result = getDateOfBirth(ptr); if (ptr.get() != null) { throw new NSErrorException(ptr.get()); } return result; } /**
/** * @since Available in iOS 8.2 and later. */ public static NSObject observeUserPreferencesDidChange(HKHealthStore object, final VoidBlock1<HKHealthStore> block) { return NSNotificationCenter.getDefaultCenter().addObserver(UserPreferencesDidChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((HKHealthStore) a.getObject()); } }); } }
@Method(selector = "bloodTypeWithError:") private native HKBloodTypeObject getBloodType(NSError.NSErrorPtr error); /**
@Method(selector = "biologicalSexWithError:") private native HKBiologicalSexObject getBiologicalSex(NSError.NSErrorPtr error); public HKBloodTypeObject getBloodType() throws NSErrorException {
/** * @since Available in iOS 8.0 and later. * @deprecated Deprecated in iOS 10.0. */ @Deprecated public NSDate getDateOfBirth() throws NSErrorException { NSError.NSErrorPtr ptr = new NSError.NSErrorPtr(); NSDate result = getDateOfBirth(ptr); if (ptr.get() != null) { throw new NSErrorException(ptr.get()); } return result; } /**
/** * @since Available in iOS 8.2 and later. */ public static NSObject observeUserPreferencesDidChange(HKHealthStore object, final VoidBlock1<HKHealthStore> block) { return NSNotificationCenter.getDefaultCenter().addObserver(UserPreferencesDidChangeNotification(), object, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((HKHealthStore) a.getObject()); } }); } }
@Method(selector = "bloodTypeWithError:") private native HKBloodTypeObject getBloodType(NSError.NSErrorPtr error); /**
@Method(selector = "biologicalSexWithError:") private native HKBiologicalSexObject getBiologicalSex(NSError.NSErrorPtr error); public HKBloodTypeObject getBloodType() throws NSErrorException {