0

Is this true: Nor does intent just pass data between activities but also saves it? For example, I'm passing an array of data (checked items from the list) to the main activity with Intent and then show it there. Will this data be shown on next app launch?

Aleksey Bulin
  • 85
  • 2
  • 9

1 Answers1

0

yes you can share data between the Intent :To send data

String[] data={"your dat"};
Intent myIntent=new Intent(this,NewActivity.class);
myIntent.putExtra("INFORMATION",data);
startActivity(myIntent);

Now in your NewActivity.class inside onCreate(...) method you can get these values

String[] name=getIntent().getStringArrayExtra("INFORMATION");

same way you can send putExtra of any data type and retrieve corresponding data type with getExtra method

Sanjeev
  • 4,255
  • 3
  • 28
  • 37