마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

Activity에서 fragment로 데이터 전달 질문드립니다. [closed]

0 추천

activity에서 fragment를 실행하면서, 해당 fragment로 데이터를 전달하려고 합니다. 데이터는 string 또는 int입니다.

현재 

activity 상에서 아래와 같이 fragment를 호출하고 있습니다. 

              Fragment fragment = null;
              fragment = new GroupListFragment();
              m_FragmentManager = getFragmentManager();
              m_FragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();

Fragment에서 는 아래와 같이 생성되고 있습니다. 

    public static GroupListFragment newInstance(String param1, String param2) {
        GroupListFragment fragment = new GroupListFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }

    public GroupListFragment() {
        // Required empty public constructor
    }

간단한 데이터 전달이 가능할것 같은데, 조언 부탁드립니다. 

질문을 종료한 이유: 답을 찾았습니다.
익명사용자 님이 2015년 7월 3일 질문
2015년 7월 3일 closed
...