【Android】Intent 에서 Extra 를 사용 하여 데 이 터 를 전달 합 니 다.

값 전달 방법 1
Intent intent = new Intent();
Bundle bundle = new Bundle(); //        
bundle.putString("name", "tom"); 
bundle.putString("ip","8.8.8.8");
intent.putExtras(bundle); // Intent       

값 전달 방법 2
Intent intent = new Intent();
intent.putExtra("name", "tom"); 
intent.putExtra("money", 1098978009L);

획득 값
Bundle bundle=getIntent().getExtras();
String name=bundle.getString("name");

좋은 웹페이지 즐겨찾기