안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요.
Intent i = new Intent(mContext, HomeActivity.class);
Bundle extra = new Bundle();
extra.putString("aa", "1");
i.putExtras(extra);
mNotification = new Notification(R.drawable.icon_alarm_24, ticker,System.currentTimeMillis());
PendingIntent intent = PendingIntent.getActivity(mContext,0,i, 7);
mNotification.setLatestEventInfo(mContext, sTitle, sMsg, intent);
notifier.notify(5222, mNotification);
이렇게 값을 1이란 값을 넘기고
Intent i = getIntent();
String camJID = i.getStringExtra("aa");
if(camJID != null)
{
System.out.println("aa : " + camJID);
}
이렇게 aa의 값을 받았습니다.
첫번째는 제대로 받았는데 1 대신 다른 값을 집어 넣어도 계속 1이 찍혀요~~
왜그럴까요..?? 아시는 분 답변 좀 부탁드릴께요 .^^
읽어주셔서 감사합니다.




PendingIntent.getActivity하실때 requestCode코드 값이 계속 0인거 같아서 그런것 같네요
아마 저상태면 맨마지막에 보내진 값만 전달될것 같은데요?
requestCode값이 식별하는 값이니 requestCode값을 변경해서 등록하시면 될것같은데요?
1씩 증가한다던가 전역변수로 하나하나 선언하시던가뭐... 아마도 그러면 될것 같네요