Twitter Facebook Delicious Digg Stumbleupon Favorites More

Friday 27 July 2018

intent data passing example


In your current Activity, create a new Intent:
String value="Hello world";
Intent i = new Intent(CurrentActivity.this, NewActivity.class);    
i.putExtra("key",value);
startActivity(i);
Then in the new Activity, retrieve those values:
Bundle extras = getIntent().getExtras();
if (extras != null) {
    String value = extras.getString("key");
    //The key argument here must match that used in the other activity
}
Share:

0 comments:

Post a Comment

Search This Blog

Popular Posts

Pages

how to make crores from 1 lakh in stock markets in 1 year

how to make crores from 1 lakh in stock markets in 1 year

Blogger Tutorials

Blogger Templates

Sample Text

Copyright © ANDROID TUTORIAL CODE | Powered by Blogger
Design by SimpleWpThemes | Blogger Theme by NewBloggerThemes.com & Distributed By Protemplateslab