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?
Asked
Active
Viewed 2,763 times
0
-
No the data will not be shown on next app launch – Gopal Singh Sirvi Jul 01 '15 at 04:38
-
Mainly purpose of intent is passing data.You can store this kind of data in Shared Preferences. – Pranav P Jul 01 '15 at 04:39
-
check my answer i m storing values in intent and retriving those value in onother activitiy – Tufan Jul 01 '15 at 04:57
1 Answers
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