Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. A -> B -> C -> D-> C
  2.  
  3. Intent i = new Intent(new Intent(C.this, D.class);
  4. startActivityForResult(i, 0);
  5.  
  6. Intent i = new Intent();
  7. i.putExtra(); // insert your extras here
  8. setResult(0, i);
  9.  
  10. protected void onActivityResult(int requestCode, int resultCode,
  11. Intent data) {
  12. if (requestCode == PICK_CONTACT_REQUEST) {
  13. if (resultCode == RESULT_OK) {
  14. // A contact was picked. Here we will just display it
  15. // to the user.
  16. startActivity(new Intent(Intent.ACTION_VIEW, data));
  17.  
  18. /*
  19. can also get the extra sent back through data
  20. using data.getStringExtra("someKey");
  21. assuming the extra was a String
  22. */
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement