I try to transfer data from one activation to another. As a result, it returns null. I can not understand why. variables points, countTry, sec - ints.
new AlertDialog.Builder(this) .setTitle("Congratulations!") .setMessage("Do you want to save the result?") .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Intent intent = new Intent(getBaseContext(), SaveScoreActivity.class); intent.putExtra("points", points); intent.putExtra("try", countTry); intent.putExtra("time", sec); startActivity(intent); } }) In another activity
Intent intent = new Intent(); String countTry = intent.getStringExtra("try"); String points = intent.getStringExtra("points"); String time = intent.getStringExtra("time"); etPoints.setText(points + ""); etTry.setText(countTry+ ""); etTime.setText(time + "");