我对 Android 开发非常陌生。
我有这个:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(R.string.message_user_registered)
.setCancelable(false)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Intent intent =
new Intent(GameDescriptionActivity.this,
GameHomeActivity.class);
Bundle extraData = new Bundle();
extraData.putInt(Constants.GAME_ID, this.gameId);
startActivity(intent);
}
});
AlertDialog alert = builder.create();
alert.show();
但是这条线不起作用:
extraData.putInt(Constants.GAME_ID, this.gameId);
我无法访问this.gameId
.
我怎样才能解决这个问题?
谢谢。