We all go through the phase when we are not interested in anything. Even our most passionate hobbies. Writing is no exception.
I found when I am in this mode I can afford a couple of days away from writing, but that is it.
I know from experience that you can't let go much longer than that without drying out your creative juices.
I have seen it with other writers and experienced myself, the longer you stay away from writing the harder it is to get back into the rhythm of writing.
Treat writing like a job. You go to work when you don't feel like it, you have to write when you don't feel like it too.
One trick that works for me is critiquing what I have already written. This seems to help me get back into the world I am creating.
As for anyone else, I guess you will have to stumble on to what works for you. The key is to keep writing.