Java Code Examples for com.google.example.games.basegameutils.BaseGameUtils#showActivityResultError()

The following examples show how to use com.google.example.games.basegameutils.BaseGameUtils#showActivityResultError() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlayActivity.java    From FixMath with Apache License 2.0 6 votes vote down vote up
protected void onActivityResult(int requestCode, int resultCode,
                                Intent intent) {
    if (requestCode == RC_SIGN_IN) {
        mSignInClicked = false;
        mResolvingConnectionFailure = false;
        if (resultCode == RESULT_OK) {
            googleApiClient.connect();
        } else {
            // Bring up an error dialog to alert the user that sign-in
            // failed. The R.string.signin_failure should reference an error
            // string in your strings.xml file that tells the user they
            // could not be signed in, such as "Unable to sign in."
            BaseGameUtils.showActivityResultError(this,
                    requestCode, resultCode, R.string.signin_failure);

            SharedPreferences scorePref = getSharedPreferences("LOGGING", MODE_PRIVATE);
            SharedPreferences.Editor editor = scorePref.edit();
            editor.putBoolean("SIGN_STATUS", false);
            editor.commit();


        }
    }


}
 
Example 2
Source File: MenuActivity.java    From FixMath with Apache License 2.0 6 votes vote down vote up
protected void onActivityResult(int requestCode, int resultCode,
                                Intent intent) {
    if (requestCode == RC_SIGN_IN) {
        mSignInClicked = false;
        mResolvingConnectionFailure = false;
        if (resultCode == RESULT_OK) {
            mGoogleApiClient.connect();
        } else {
            // Bring up an error dialog to alert the user that sign-in
            // failed. The R.string.signin_failure should reference an error
            // string in your strings.xml file that tells the user they
            // could not be signed in, such as "Unable to sign in."
            BaseGameUtils.showActivityResultError(this,
                    requestCode, resultCode, R.string.signin_failure);

            SharedPreferences scorePref = getSharedPreferences("LOGGING", MODE_PRIVATE);
            SharedPreferences.Editor editor = scorePref.edit();
            editor.putBoolean("SIGN_STATUS", false);
            editor.commit();


        }
    }


}
 
Example 3
Source File: SettingsActivity.java    From FixMath with Apache License 2.0 6 votes vote down vote up
protected void onActivityResult(int requestCode, int resultCode,
                                Intent intent) {
    if (requestCode == RC_SIGN_IN) {
        mSignInClicked = false;
        mResolvingConnectionFailure = false;
        if (resultCode == RESULT_OK) {
            mGoogleApi.connect();
        } else {
            // Bring up an error dialog to alert the user that sign-in
            // failed. The R.string.signin_failure should reference an error
            // string in your strings.xml file that tells the user they
            // could not be signed in, such as "Unable to sign in."
            BaseGameUtils.showActivityResultError(this,
                    requestCode, resultCode, R.string.signin_failure);

            SharedPreferences scorePref = getSharedPreferences("LOGGING", MODE_PRIVATE);
            SharedPreferences.Editor editor = scorePref.edit();
            editor.putBoolean("SIGN_STATUS", false);
            editor.commit();

        }
    }

}
 
Example 4
Source File: TimeAttackActivity.java    From FixMath with Apache License 2.0 6 votes vote down vote up
protected void onActivityResult(int requestCode, int resultCode,
                                Intent intent) {
    if (requestCode == RC_SIGN_IN) {
        mSignInClicked = false;
        mResolvingConnectionFailure = false;
        if (resultCode == RESULT_OK) {
            mGoogleApiClient.connect();
        } else {
            // Bring up an error dialog to alert the user that sign-in
            // failed. The R.string.signin_failure should reference an error
            // string in your strings.xml file that tells the user they
            // could not be signed in, such as "Unable to sign in."
            BaseGameUtils.showActivityResultError(this,
                    requestCode, resultCode, R.string.signin_failure);

            SharedPreferences scorePref = getSharedPreferences("LOGGING", MODE_PRIVATE);
            SharedPreferences.Editor editor = scorePref.edit();
            editor.putBoolean("SIGN_STATUS", false);
            editor.commit();


        }
    }


}
 
Example 5
Source File: ChooseTimeChallenge.java    From FixMath with Apache License 2.0 6 votes vote down vote up
protected void onActivityResult(int requestCode, int resultCode,
                                Intent intent) {
    if (requestCode == RC_SIGN_IN) {
        mSignInClicked = false;
        mResolvingConnectionFailure = false;
        if (resultCode == RESULT_OK) {
            mGoogleApiClient.connect();
        } else {
            // Bring up an error dialog to alert the user that sign-in
            // failed. The R.string.signin_failure should reference an error
            // string in your strings.xml file that tells the user they
            // could not be signed in, such as "Unable to sign in."
            BaseGameUtils.showActivityResultError(this,
                    requestCode, resultCode, R.string.signin_failure);

            SharedPreferences scorePref = getSharedPreferences("LOGGING", MODE_PRIVATE);
            SharedPreferences.Editor editor = scorePref.edit();
            editor.putBoolean("SIGN_STATUS", false);
            editor.commit();


        }
    }


}
 
Example 6
Source File: BaseGooglePlayServicesActivity.java    From Onesearch with MIT License 5 votes vote down vote up
protected void onActivityResult(int requestCode, int resultCode,
                                Intent intent) {
    if (requestCode == RC_SIGN_IN) {
        mSignInClicked = false;
        mResolvingConnectionFailure = false;
        if (resultCode == RESULT_OK) {
            mGoogleApiClient.connect();
        } else {
            BaseGameUtils.showActivityResultError(this,
                    requestCode, resultCode, R.string.sign_in_failed);
        }
    }
}