app/src/main/java/edu/washington/briluu/quizdroid/PreferencesActivity.java
// otherwise pops a toast to let user that it is not connected
otherwise pops a toast to let user that it is not connected
otherwise pops a toast to let user that it is not connected
public boolean isNetworkConnected() {
        if (!isNetworkAvailable()) {
            if (isAirplaneModeOn()) {
                FragmentManager fm = this.getFragmentManager();
                DialogFragment dialogFragment = new AirplaneModeDialogFragment();
                dialogFragment.show(fm, "AirPlaneModeDialogFragment");
            } else {
                Log.w("MenuActivity", "Not connected to the internet.");
                Toast.makeText(getApplicationContext(), "No access to internet! :(",
                        Toast.LENGTH_SHORT).show();
            }
            return false;
        } else {
            return true;
        }
    }
public boolean isNetworkConnected ( ) { if ( ! isNetworkAvailable ( ) ) { if ( isAirplaneModeOn ( ) ) { FragmentManager fm = this . getFragmentManager ( ) ; DialogFragment dialogFragment = new AirplaneModeDialogFragment ( ) ; dialogFragment . show ( fm , "AirPlaneModeDialogFragment" ) ; } else { Log . w ( "MenuActivity" , "Not connected to the internet." ) ; Toast . makeText ( getApplicationContext ( ) , "No access to internet! :(" , Toast . LENGTH_SHORT ) . show ( ) ; } return false ; } else { return true ; } }
otherwise pops a toast to let user that it is not connected
otherwise pops a toast to let user that it is not connected
// "punt gracefully"