Silver-nanoparticles-loaded chitosan foam as a flexible SERS substrate for active collecting analytes from both solid surface and solution.