Green World

반응형

[안드로이드] 액티비티간 파라미터 넘기기







Intent myIntent = new Intent(getApplicationContext(), Baseball.class);




   int paramSbjId = trialCntGroup.getCheckedRadioButtonId();


   if(paramSbjId == R.id.trialCnt1){


   myIntent.putExtra("paramSubject", "sub00");


   }else if(paramSbjId == R.id.trialCnt2){


   myIntent.putExtra("paramSubject", "sub01");


   }else if(paramSbjId == R.id.trialCnt3){


   myIntent.putExtra("paramSubject", "sub02");


   }else if(paramSbjId == R.id.trialCnt4){


   myIntent.putExtra("paramSubject", "sub03");


   }else if(paramSbjId == R.id.trialCnt5){


   myIntent.putExtra("paramSubject", "sub04");


   }else{


   myIntent.putExtra("paramSubject", "sub00");




   }





  startActivity(myIntent);





액티비티 넘어가고 나서





subject = intent.getStringExtra("paramSubject");


로 받는다.^^










반응형