I have a little problem with my code. I want to transfer three int values in to my next activity. Unfortunatelly my following code returns me 3x one value. For example predkosc = 5 kat = 10 ramie = 15 and intent returns my in second activity predkosc = 15 kat = 15 ramie = 15 What is wrong iny my code? Code A:
public static String predkosc_VALUE = "";
public static String kat_VALUE = "";
public static String ramie_VALUE = "";
Intent intent = new Intent(this, Rzut_katapulta.class);
EditText Text_predkosc = (EditText) findViewById(R.id.editText1);
EditText Text_kat = (EditText) findViewById(R.id.editText2);
EditText Text_ramie = (EditText) findViewById(R.id.editText3);
String message_predkosc = Text_predkosc.getText().toString();
int predkosc = Integer.parseInt(message_predkosc);
String message_kat = Text_kat.getText().toString();
int kat = Integer.parseInt(message_kat);
String message_ramie = Text_ramie.getText().toString();
int ramie = Integer.parseInt(message_ramie);
intent.putExtra(predkosc_VALUE, predkosc);
intent.putExtra(kat_VALUE, kat);
intent.putExtra(ramie_VALUE, ramie);
startActivity(intent);
Code B:
Intent intent = getIntent();
predkosc = intent.getIntExtra(Main_menu.predkosc_VALUE,0);
katy = intent.getIntExtra(Main_menu.kat_VALUE,0);
ramie = intent.getIntExtra(Main_menu.ramie_VALUE,0);