Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.42 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // int first class
  2.  
  3. Intent intent = new Intent();
  4. Bundle bundle = new Bundle();
  5. bundle.putString("Key_str","my string");
  6. bundle.putInt("Key_int",100000);
  7. intent.putExtras(bundle);
  8. intent.setClass(this,nextClass.class);
  9. startActivity(intent);
  10.  
  11.  
  12.  
  13. // in secord class
  14.  
  15. onCreate(){
  16.  
  17. Bundle bundle = this.getIntent().getExtras();
  18. int x = bundle.getInt("key_int");
  19. String str = bundle.getString("Key_str");
  20.  
  21.  
  22.  
  23. }