recyclerview
https://mommoo.tistory.com/2
Activity에서 Fragment로 값 넘기기
Activity
getSupportFragmentManager().beginTransaction().add(R.id.container, fragment1).commit();
//번들객체 생성, text값 저장
Bundle bundle = new Bundle();
bundle.putString("type",type);
//fragment1로 번들 전달
fragment1.setArguments(bundle);
Fragment
@Override
public void onCreate ( Bundle savedInstanceState ) {
super . onCreate (savedInstanceState);
//RequestActivity에서 전달한 번들 저장
try {
Bundle bundle = getArguments();
if(bundle != null) {
type = bundle.getString("type");
}
} catch(Exception e) {
Log.d("오류",String.valueOf(e));
}
}
xml 오른쪽 정렬
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"
/>