i found several thread “title like me “but my qus is diffrent .my qus is using intent can i send the data to only next calling activity?can i dont use that getExtra() method in other activity means can i get the data in any activity via using “key”?
as for example…
int number=5;
Intent i = new Intent(A.this, B.class);
i.putExtra("numbers", number);
startActivity(i);
In the activity B i get the info:
Bundle extras = getIntent().getExtras();
int arrayB = extras.getInt("numbers");
can i get it in any other activity also…?
no. you cannot get this in another activity unless you can not send this intent to that Activity.
An Intent object is a bundle of information. when you startActivity we pass the information to that activity. If you want to use this bundle into another activity you have pass to that activity.
you can do to pass the bundle of information as the level like
A->B->C
here Activity A start the activity and pass the information to the B Activity and same bundle you can pass to the C Activity as you send directly A->C