Good afternoon,
What is the best way to deal with connectivity issues (no data or wifi enabled, wifi or data enabled but no internet, possibly timeouts, etc)? Right now I'm putting code dealing those scenarios in each separate activity (that uses data) but it occurred to me that maybe there is a design pattern (that I don't know about) that describes a way of putting this code in just one place of the app instead of having to repeat it? I've looked around and haven't found anything. It's not that much code but the fact that I have to repeat it bothers me. Any suggestion would be appreciated.
What is the best way to deal with connectivity issues (no data or wifi enabled, wifi or data enabled but no internet, possibly timeouts, etc)? Right now I'm putting code dealing those scenarios in each separate activity (that uses data) but it occurred to me that maybe there is a design pattern (that I don't know about) that describes a way of putting this code in just one place of the app instead of having to repeat it? I've looked around and haven't found anything. It's not that much code but the fact that I have to repeat it bothers me. Any suggestion would be appreciated.