Home이라는 프래그먼트와 Study라는 프래그먼트가 있습니다.
Home > Study로 데이터를 전달하려고 합니다.
Bundle bundle = new Bundle(4);
bundle.putString("db", db);
bundle.putInt("img", img);
bundle.putString("title", title);
bundle.putString("singer", singer);
Study study = new Study();
study.setArguments(bundle);
해당 코드를 통해 Home에서 각각의 데이터를 Bundle을 사용해 보내주었습니다.
Bundle bundle = getArguments();
if(bundle != null) {
db = bundle.getString("db");
title_name = bundle.getString("title");
img = bundle.getInt("img",0);
}
또한, Study 코드에서 해당 데이터를 저장하였습니다.
하지만 Log결과 Null값으로, 데이터가 넘어오지않았습니다.
이유를 모르겠습니다. 도와주세요 ㅜ