A transparent ultraviolet (UV) sensor using nanoheterojunctions (NHJs) composed of p-type NiO nanoflowers (NFs) and n-type ZnO nanowires (NWs) was prepared through a sequential low-temperature hydrothermal-growth process. The devices that were annealed in an oxygen (O2) ambient exhibited better rectification behavior (I forward/I reverse = 427), a lower forward threshold voltage (V(th) = 0.98 V), a lower leakage current (1.68 x 10(-5) A/cm2), and superior sensitivity (I uv/I dark = 57.8; I visible/I dark = 1.25) to UV light (lambda = 325 nm) than the unannealed devices. The remarkably improved device performances and optoelectronic characteristics of the annealed p-NiO-NF/n-ZnO-NW NHJs can be associated with their fewer structural defects, fewer interfacial defects, and better crystallinity. A stable and repeatable operation of dynamic photoresponse was also observed in the annealed devices. The excellent sensitivity and repeatable photoresponse to UV light of the hydrothermally grown p-NiO-NF/n-ZnO-NW NHJs annealed in a suitable O2 ambient indicate that they can be applied to nano-integrated optoelectronic devices.