Home > DeveloperSection > Interviews > How will you pass data to sub-activities?

Posted on    May-28-2015 12:06 AM

 Android Android 
Ratings:
 1 Answer(s)
  851  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    May-28-2015 12:06 AM

We can use Bundles to pass data to sub-activities. There are like HashMaps that and take trivial data types. These Bundles transport information from one Activity to another
Bundle b = new Bundle();
        b.putString("EMAIL", "abc@xyz.com");
        i.putExtras(b); // where i is the intent

        ...

Don't want to miss updates? Please click the below button!

Follow MindStick