A multifunctional fluorescent probe P based on a naphthalimide derivative for the detection of Ag+ and Hg2+ through a dual-signal was designed and characterized. P exhibited a large Stokes shift (107 nm), high selectivity, good sensitivity, and fast response time. By adjusting the testing medium and the order of reagent addition, multifunctional detection with P was achieved. The addition of Ag+ or Hg2+ to P solution in either ethanol or an ethanol–water mixture resulted in a significant quenching of fluorescence emission at 537 nm and caused a decrease in the absorbance at 440 nm accompanied by the appearance of a new absorption peak at around 340 nm, and there was an obvious color change from yellow to colorless. In contrast, the addition of other common metal ions and anions did not produce substantial spectral or color changes. The detection limit of probe P for Ag+ and Hg2+ was calculated to be 0.33 μM. The sensing mechanism was proposed and validated through MS and 1H NMR spectrometry methods. Additionally, P demonstrated the capability to recognize Ag+ and Hg2+ in living cells with satisfactory results.