Created
September 21, 2012 15:04
-
-
Save samadli/3762034 to your computer and use it in GitHub Desktop.
Passing and Getting parameters between Activities
This file contains hidden or 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
| public class GetActivity extends Activity { | |
| @Override | |
| public void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.get_activity_layout); | |
| Intent myIntent= getIntent(); | |
| String parameter = myIntent.getStringExtra("paramKey"); | |
| } | |
| } |
This file contains hidden or 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
| public class PassActicity extends Activity { | |
| @Override | |
| public void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.pass_activity_layout); | |
| Intent myIntent = new Intent(PassActivity.this, GetActivity.class); | |
| myIntent.putExtra("paramKey", "param"); | |
| startActivity(GetActivity); | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment