I want a value to be passed from the first to the last activity when a button is clicked.
At the same time I want this button to bring me to the second activity. Somehow this doesn't work.
private void imagebutton1 () {
ImageButton btn = (ImageButton) findViewById(R.id.imageButton4);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//startActivity (new Intent(Akt1.this,Akt2.class));
String data1 = "data1";
Intent intent = new Intent (Akt1.this,Akt2.class);
Intent passdata_intent = new Intent(Akt1.this, Akt6.class);
passdata_intent.putExtra("data1",data1);
startActivity(passdata_intent);
}
});