Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Current Activity (Sender) */
- Intent editScreenIntent = new Intent(ListDataActivity.this, EditDataActivity.class);
- editScreenIntent.putExtra("id",itemID);
- editScreenIntent.putExtra("name",name);
- startActivity(editScreenIntent);
- /* Second Activity (Receiver) */
- //get the intent extra from the ListDataActivity
- Intent receivedIntent = getIntent();
- //now get the itemID we passed as an extra
- selectedID = receivedIntent.getIntExtra("id",-1); //NOTE: -1 is just the default value
- //now get the name we passed as an extra
- selectedName = receivedIntent.getStringExtra("name");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement