当前位置: 首页>>代码示例>>Java>>正文


Java BaseGameUtils.showActivityResultError方法代码示例

本文整理汇总了Java中com.google.example.games.basegameutils.BaseGameUtils.showActivityResultError方法的典型用法代码示例。如果您正苦于以下问题:Java BaseGameUtils.showActivityResultError方法的具体用法?Java BaseGameUtils.showActivityResultError怎么用?Java BaseGameUtils.showActivityResultError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.example.games.basegameutils.BaseGameUtils的用法示例。


在下文中一共展示了BaseGameUtils.showActivityResultError方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
    if (requestCode == RC_SIGN_IN) {
        mSignInClicked = true;
        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);
        }
    }
}
 
开发者ID:BloopApp,项目名称:Bloop,代码行数:17,代码来源:PlayLoginActivity.java

示例2: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
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();


        }
    }


}
 
开发者ID:hypeapps,项目名称:FixMath,代码行数:27,代码来源:PlayActivity.java

示例3: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
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();


        }
    }


}
 
开发者ID:hypeapps,项目名称:FixMath,代码行数:27,代码来源:MenuActivity.java

示例4: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
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();

        }
    }

}
 
开发者ID:hypeapps,项目名称:FixMath,代码行数:25,代码来源:SettingsActivity.java

示例5: onMainActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
protected void onMainActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == RC_SIGN_IN) {
        mSignInClicked = false;
        mResolvingConnectionFailure = false;
        if (resultCode == Activity.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(mActivity,
                    requestCode, resultCode, R.string.gamehelper_unknown_error);
        }
    }
}
 
开发者ID:ianholing,项目名称:Crazy-wheel-godot-google-play,代码行数:17,代码来源:GodotGoogleGamePlayServices.java

示例6: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
    if (requestCode == RC_SIGN_IN) {
        mSignInClicked = false;
        mResolvingConnectionFailure = false;
        if (mGoogleApiClient != null && resultCode == RESULT_OK)
            mGoogleApiClient.connect();
        else
            BaseGameUtils.showActivityResultError(this, requestCode, resultCode, R.string.sign_in_failure);
    }
}
 
开发者ID:TheAndroidMaster,项目名称:Rocket,代码行数:11,代码来源:MainActivity.java

示例7: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
    if (requestCode == RC_SIGN_IN) {
        mSignInClicked = false;
        mResolvingConnectionFailure = false;
        if (mGoogleApiClient != null && resultCode == RESULT_OK) {
            mGoogleApiClient.connect();
        } else {
            BaseGameUtils.showActivityResultError(this, requestCode, resultCode, R.string.sign_in_failure);
        }
    }
}
 
开发者ID:TheAndroidMaster,项目名称:Rocket,代码行数:12,代码来源:FlappyActivity.java

示例8: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
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_failure);
        }
    }
}
 
开发者ID:TheAndroidMaster,项目名称:Rocket,代码行数:12,代码来源:OptionsActivity.java

示例9: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
    super.onActivityResult(requestCode, resultCode, intent);
    if (requestCode == RC_SIGN_IN) {
        mSignInClicked = false;
        mResolvingConnectionFailure = false;
        if (resultCode == RESULT_OK) {
            mGoogleApiClient.connect();
        } else {
            BaseGameUtils.showActivityResultError(this, requestCode, resultCode, R.string.signin_other_error);
        }
    }
}
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:14,代码来源:MainActivity.java

示例10: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    switch (requestCode) {
        case SEND_REQUEST_CODE:
            if (resultCode == GamesActivityResultCodes.RESULT_SEND_REQUEST_FAILED) {
                Toast.makeText(this, "FAILED TO SEND REQUEST!",
                        Toast.LENGTH_LONG).show();
            }
            break;
        case SEND_GIFT_CODE:
            if (resultCode == GamesActivityResultCodes.RESULT_SEND_REQUEST_FAILED) {
                Toast.makeText(this, "FAILED TO SEND GIFT!", Toast.LENGTH_LONG)
                        .show();
            }
            break;
        case SHOW_INBOX:
            if (resultCode == Activity.RESULT_OK && data != null) {
                handleRequests(Games.Requests
                        .getGameRequestsFromInboxResponse(data));
            } else {
                Log.e(TAG, "Failed to process inbox result: resultCode = "
                        + resultCode + ", data = "
                        + (data == null ? "null" : "valid"));
            }
            break;
        case RC_SIGN_IN:
            Log.d(TAG, "onActivityResult with requestCode == RC_SIGN_IN, responseCode="
                    + resultCode + ", intent=" + data);
            mSignInClicked = false;
            mResolvingConnectionFailure = false;
            if (resultCode == RESULT_OK) {
                mGoogleApiClient.connect();
            } else {
                BaseGameUtils.showActivityResultError(this, requestCode, resultCode, R.string.signin_other_error);
            }
            break;
    }
    super.onActivityResult(requestCode, resultCode, data);
}
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:40,代码来源:BeGenerousActivity.java

示例11: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
protected void onActivityResult(int requestCode, int responseCode, Intent intent) {
  if (requestCode == RC_SIGN_IN) {
    Log.d(TAG, "onActivityResult with requestCode == RC_SIGN_IN, responseCode="
        + responseCode + ", intent=" + intent);
    mSignInClicked = false;
    mResolvingConnectionFailure = false;
    if (responseCode == RESULT_OK) {
      mGoogleApiClient.connect();
    } else {
      BaseGameUtils.showActivityResultError(this,requestCode,responseCode, R.string.signin_other_error);
    }
  }
}
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:14,代码来源:MainActivity.java

示例12: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
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);
        }
    }
}
 
开发者ID:chrisjluc,项目名称:Onesearch,代码行数:14,代码来源:BaseGooglePlayServicesActivity.java

示例13: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int responseCode, Intent intent) {
  super.onActivityResult(requestCode, responseCode, intent);
  Log.d(TAG, String.format("onActivityResult requestCode = %d, responseCode = %d", requestCode, responseCode));
  switch (requestCode) {
    case RC_SELECT_PLAYER:
      if (responseCode == RESULT_OK) {
        androidGameRepository.handlePlayersSelected(intent);
      } else {
        setWaitingScreenVisible(false);
      }
      break;
    case RC_CHECK_MATCHES:
      androidGameRepository.handleCheckMatchesResult(responseCode, intent);
      break;
    case RC_REQUEST_ACHIEVEMENTS:
      break;
    case RC_SIGN_IN:
      signInClicked = false;
      resolvingError = false;
      if (responseCode == RESULT_OK) {
        googleApiClient.connect();
      } else {
        BaseGameUtils.showActivityResultError(this, requestCode, responseCode, R.string.signin_other_error);
      }
      break;
    default:
      Log.e(TAG, "onActivityResult unexpected requestCode " + requestCode);
  }
}
 
开发者ID:cauchymop,项目名称:goblob,代码行数:31,代码来源:MainActivity.java

示例14: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int responseCode,
        Intent intent) {
    super.onActivityResult(requestCode, responseCode, intent);

    switch (requestCode) {
        case RC_SELECT_PLAYERS:
            // we got the result from the "select players" UI -- ready to create the room
            handleSelectPlayersResult(responseCode, intent);
            break;
        case RC_INVITATION_INBOX:
            // we got the result from the "select invitation" UI (invitation inbox). We're
            // ready to accept the selected invitation:
            handleInvitationInboxResult(responseCode, intent);
            break;
        case RC_WAITING_ROOM:
            // we got the result from the "waiting room" UI.
            if (responseCode == Activity.RESULT_OK) {
                // ready to start playing
                Log.d(TAG, "Starting game (waiting room returned OK).");
                startGame(true);
            } else if (responseCode == GamesActivityResultCodes.RESULT_LEFT_ROOM) {
                // player indicated that they want to leave the room
                leaveRoom();
            } else if (responseCode == Activity.RESULT_CANCELED) {
                // Dialog was cancelled (user pressed back key, for instance). In our game,
                // this means leaving the room too. In more elaborate games, this could mean
                // something else (like minimizing the waiting room UI).
                leaveRoom();
            }
            break;
        case RC_SIGN_IN:
            Log.d(TAG, "onActivityResult with requestCode == RC_SIGN_IN, responseCode="
                + responseCode + ", intent=" + intent);
            mSignInClicked = false;
            mResolvingConnectionFailure = false;
            if (responseCode == RESULT_OK) {
              mGoogleApiClient.connect();
            } else {
              BaseGameUtils.showActivityResultError(this,requestCode,responseCode, R.string.signin_other_error);
            }
            break;
    }
    super.onActivityResult(requestCode, responseCode, intent);
}
 
开发者ID:ezet,项目名称:penguins-in-space,代码行数:46,代码来源:Example.java

示例15: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onActivityResult(int request, int response, Intent data) {
    super.onActivityResult(request, response, data);
    if (request == RC_SIGN_IN) {
        mSignInClicked = false;
        mResolvingConnectionFailure = false;
        if (response == Activity.RESULT_OK) {
            mGoogleApiClient.connect();
        } else {
            BaseGameUtils.showActivityResultError(this, request, response, R.string.signin_other_error);
        }
    } else if (request == RC_LOOK_AT_MATCHES) {
        // Returning from the 'Select Match' dialog

        if (response != Activity.RESULT_OK) {
            // user canceled
            return;
        }

        TurnBasedMatch match = data
                .getParcelableExtra(Multiplayer.EXTRA_TURN_BASED_MATCH);

        if (match != null) {
            updateMatch(match);
        }

        Log.d(TAG, "Match = " + match);
    } else if (request == RC_SELECT_PLAYERS) {
        // Returned from 'Select players to Invite' dialog

        if (response != Activity.RESULT_OK) {
            // user canceled
            return;
        }

        // get the invitee list
        final ArrayList<String> invitees = data
                .getStringArrayListExtra(Games.EXTRA_PLAYER_IDS);

        // get automatch criteria
        Bundle autoMatchCriteria = null;

        int minAutoMatchPlayers = data.getIntExtra(
                Multiplayer.EXTRA_MIN_AUTOMATCH_PLAYERS, 0);
        int maxAutoMatchPlayers = data.getIntExtra(
                Multiplayer.EXTRA_MAX_AUTOMATCH_PLAYERS, 0);

        if (minAutoMatchPlayers > 0) {
            autoMatchCriteria = RoomConfig.createAutoMatchCriteria(
                    minAutoMatchPlayers, maxAutoMatchPlayers, 0);
        } else {
            autoMatchCriteria = null;
        }

        TurnBasedMatchConfig tbmc = TurnBasedMatchConfig.builder()
                .addInvitedPlayers(invitees)
                .setAutoMatchCriteria(autoMatchCriteria).build();

        // Start the match
        Games.TurnBasedMultiplayer.createMatch(mGoogleApiClient, tbmc).setResultCallback(
                new ResultCallback<TurnBasedMultiplayer.InitiateMatchResult>() {
            @Override
            public void onResult(TurnBasedMultiplayer.InitiateMatchResult result) {
                processResult(result);
            }
        });
        showSpinner();
    }
}
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:70,代码来源:SkeletonActivity.java


注:本文中的com.google.example.games.basegameutils.BaseGameUtils.showActivityResultError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。