You're accessing a static field (CONNECTIVITY_SERVICE) through an object instead of its class.
Replace context.CONNECTIVITY_SERVICE with Context.CONNECTIVITY_SERVICE