Created
April 15, 2014 20:27
-
-
Save uknowmeright/10769685 to your computer and use it in GitHub Desktop.
How to pass variables to a new activity in Android (Android Studio)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//step 1: | |
import android.content.Intent; | |
//step 2: add to activity you want to sav variables from | |
Intent i = new Intent(getApplicationContext(), ActivityName.class); | |
i.putExtra("someVariable","variableValue"); | |
startActivity(i); | |
//step 3: add to activity you want to pulll variables from | |
Bundle extras = getIntent().getExtras(); | |
if (extras != null) { | |
String someVariable = extras.getString("someVariable"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if i want to pass name,description and a web link.Than what should i need to do ?