本文整理汇总了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);
}
}
}
示例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();
}
}
}
示例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();
}
}
}
示例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();
}
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
示例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();
}
}