I'm writing an application in android studio IDE which shows the models,brands ,prices and etc of the cars and I want to move from one activity to another one.can I use putExtra?if yes i wonder if anyone would like to tell me how can i use it.
Asked
Active
Viewed 4,269 times
3 Answers
1
You can pass data between activities in easiest way like this.
In the first activity use out extra to send the data
Intent intent = new Intent(getBaseContext(), SignoutActivity.class);
intent.putExtra("YOUR_DATA_KEY", data);
startActivity(intent);
Access that intent on next activity like this
String s = getIntent().getStringExtra("YOUR_DATA_KEY");

Sharath kumar
- 4,064
- 1
- 14
- 20
0
try this
Intent intent=new Intent(this,YourActivity.class);
intent.putExtra("key",value);
startActivity(intent);

Arun Vinoth-Precog Tech - MVP
- 22,364
- 14
- 59
- 168

J Ramesh
- 548
- 4
- 11
-1
Try the following
Intent intent =new Intent(FirstActivity.this,SecondeActivity.class);
StartActivity(intent);

Amrutha Saj
- 1,408
- 16
- 35

Swapnil Wakchaure
- 55
- 6