A pH sensitive shape-memory polymer (SMP) was successfully prepared by grafting dansyl group into the network of polyacrylamide(pAAm). The hydrophobic aggregation at pH 5 between deprotonated dansyl group serves as a reversible phase, which would collapse at pH 2 as the dansyl group is protonated. The cross-linked pAAm chains serve as a fixing phase. It is shown that this material can be processed into temporary shape as we need at pH 5 and recover to its initial shape at pH 2. The recovery ratio and the fixity ratio are 95.4% and 94.6%, respectively.