-3

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.

H.adine
  • 11
  • 1
  • 3
  • 1
    https://developer.android.com/training/basics/firstapp/starting-activity.html follow this link to know about the intents and its uses. – Ankita Sep 12 '17 at 13:14

3 Answers3

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);
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