Are you by chance using an Apple router or access point? For some reason, they don't seem to play well with Android devices, including my M8. I've had a similar experience with 4 Android devices and 2 different Apple routers. The devices continuously disconnect and reconnect.