Á¦°¡ °øºÎÇÏ¸é¼ ´À³¤ºÎºÐ Áß¿¡ ÇϳªÀε¥
Activity À̵¿ÇÒ¶§ À̵¿Àü ActivityÀÇ °ªÀ» À̵¿ÇÒ Activity¿¡ ¾î¶»°Ô Àü´ÞÇÒ±î ÇÏ´Â °í¹ÎÀ»
¸¹ÀÌ Çß¾ú½À´Ï´Ù. staticÀ» ¾²¸é ÆíÇϱâ´Â ÇÏ°ÚÁö¸¸... ±×·¡¼ ÀÌ·±¹æ¹ýÀ» ¾Ë°Ô µÅ¾ú°í
¾û¼ºÇÑ ÄÚµå ÀÌÁö¸¸ ÇÙ½ÉÀûÀÎ? ±×·¸½À´Ï´Ù.
// ¿øÇÏ´Â °ªÀ» ´øÁö´Â ºÎºÐ
public boolean onKeyDown(int keyCode, KeyEvent event) {
int putInt = 2;
String pass_Str = "°øºÎÇսôÙ";
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
event.startTracking();
Intent AdIntent = new Intent(ÀÛ¾÷ÁßŬ·¡½º.this, À̵¿ÇÒŬ·¡½º.class);
AdIntent.putExtra("userPointListOnBack", putInt);
AdIntent.putExtra("userPointListOnBackString", pass_Str );
startActivity(AdIntent);
// finish();
return true;
}
return super.onKeyDown(keyCode, event);
}
--------------------------------------------------------------------
onKeyDownÀº ½º¸¶Æ®Æù µÚ·Î°¡±â ¹öÅÏÀ» À§ÇÑ À̺¥Æ®ÀÔ´Ï´Ù.
º¸Åë Activity À̵¿ÇϵíÀÌ ¼±¾ðÀ» Çϸç putExtra¸¦ ÀÌ¿ëÇØ
int ÇüÀº (´øÁö´Â À̸§, ´øÁö´Â °ª)
String ÇüÀº (´øÁö´Â À̸§, ´øÁö´Â °ª) ÀÔ´Ï´Ù.
--------------------------------------------------------------------
// ¿øÇÏ´Â Activity ¿¡¼ ´øÁø °ªÀ» ¹Þ´Â ºÎºÐ
Intent intent = getIntent();
int userPointListOnBack_int = intent.getIntExtra("userPointListOnBack", 0);
String OnBack_String = intent.getStringExtra("userPointListOnBackString");
--------------------------------------------------------------------
¹ÞÀ» ½Ã´Â Intent¸¦ Çϳª ¼±¾ð getIntent();·Î ¹ÞÀ¸¸ç
int ÇüÀº (´øÁøÀ̸§ Áß ³»°¡ ¹Þ°í ½ÍÀº À̸§, °ªÀÌ ¾øÀ»¶§ ÇÒ ÃʱⰪ)
- °ªÀÌ ÀÖÀ»°æ¿ì ¹Þ°í½ÍÀº À̸§ÀÇ °ªÀÌ µé¾î°¡¸ç °ªÀÌ ¾øÀ»½Ã ¼³Á¤ÇÑ ÃʱⰪ µé¾î°¨.
String ÇüÀº (´øÁøÀ̸§ Áß ³»°¡ ¹Þ°í ½ÍÀº À̸§) ÀÔ´Ï´Ù.
--------------------------------------------------------------------