Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foutmelding indien geen internet #111

Open
HeinPauwelyn opened this issue Nov 15, 2016 · 1 comment
Open

Foutmelding indien geen internet #111

HeinPauwelyn opened this issue Nov 15, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@HeinPauwelyn
Copy link
Member

Foutmelding geven indien geen internet op ELK fragment en check if (result != null) Nu crest app en is niet leuk voor gebruikers.

@mickverm
Copy link
Contributor

Interessante code in voorbeeldoefening van @walcariuss

public class ServiceHelper {

    public static boolean isDeviceOnline(Context context) {
        ConnectivityManager cm =
                (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);

        NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
        return activeNetwork != null && activeNetwork.isConnectedOrConnecting();
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants