Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to get string in another activity in android

C#
public static final String[] titles = new String[] { "lollypop",
        "Kitkat", "Jelly Been" };
Posted

If you create the activitye then pass the data to the intent you create by calling the putExtra() method of the intent. Then in your new activity call getIntent().getExtras()
 
Share this answer
 
Send data:
Java
Intent intent = new Intent();
final String[] titles = new String[] { "lollypop",
            "Kitkat", "Jelly Been" };
intent.putExtra("titles", titles);
startActivity(intent);

Receive data:
Java
Intent intent = getIntent();
String[] titles = intent.getStringArrayExtra("titles");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900