First of all, creating a new Timer is completely unnecessary.
You should reuse your Timer and create a new TimerTask instead. Likewise, you should cancel your TimerTask rather than cancelling your Timer. The second issue depends on your requirements:
1. Should it support concurrent sampling? In other words, if more than one call is made to startSampling() prior to a call to stopSampling() should more than one sampling task be started, or should duplicate calls to startSampling() be ignored if it is
already sampling?
2. If concurrent sampling is necessary, should it behave in a FIFO or FILO manner? Meaning, should the first task started be the first task stopped, or should the most recent task started be the first task stopped?
If the answer to 1 is no, then you just need a simple flag that you set when sampling is started. Future calls will check this flag and only start sampling if you aren't already. Likewise, when sampling is stopped the flag is reverted and will only attempt to stop sampling if it hasn't stopped already. In this scenario, you can simply create a new TimerTask everytime you start sampling and stop on that TimerTask.
If the answer to 1 is yes, then you will need to keep a collection of tasks started. Each call to start sampling will create a new task and add it to the collection. Each call to stop sampling will pull the first task off the collection and stop it.
One task only:
Multiple with FIFO:
Multiple with FILO would be identical but with an ArrayList and remove() rather than removeFirst().