If you get into something that requires months or years of dedication, like building something physical, writing a book or coding a desktop/web/mobile program that does help. There's some anticipation involved for the end result even if you're anhedonic and you can sink as much time into it as you feel like.
This method however, requires that you aren't completely anhedonic. I often struggle with the motives behind my programming but mostly I understand it is to fill up time and finish SOMETHING, the trick is that for that I need it to actually be enjoyable and publishable, as there would be no anticipation if I knew I was just entertaining myself and what I was crafting was shit.