다른 액티비티에서 인텐트를 넘겨받았는지 확인하는 방법이 있을까요?
어느 엑티비티의 파일 이름을을 누르면, 파일 이름을 인텐트로 넘겨주고
메인액티비티에서는 인텐트를 받고, 자동으로 파일 이름을 출력해주고 싶은데
자동으로 출력하는 부분이 안되네요. 이부분이 해결된다면
여러가지 부분이 해결될텐데 어렵네요.
Intent intent = new Intent(getApplicationContext(), mrActivity.class);
intent.putExtra("textName", "null");
startActivityForResult(intent, 0);
위에는 메인에서 인텐트를 넘겨주는 부분
Intent outIntent = new Intent(getApplicationContext(), MainActivity.class);
outIntent.putExtra("textName", strItem);
setResult(RESULT_OK, outIntent);
위에는 다른 액티비티에서 넘겨주는 부분
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
TextName = data.getStringExtra("textName");
}
}
위에는 메인 액티비티에서 인텐트 받는 부분 입니다.
인텐트가 변했을 경우를 감지하면 좋은데.. 어렵네요.