It has been a challenge to understand the experimental data on both the nuclear modification factor and elliptic flow of D0 mesons in p-Pb collisions at LHC energies. In this work, we study these collisions with an improved multi-phase transport model. By including the independent fragmentation and a significant Cronin effect (i.e., transverse momentum broadening) for charm quarks, we provide the first simultaneous description of the D0 meson RpA and v2 data at pT