Open Madi99 opened 5 years ago
MyActivity onCreate
Bundle bundle=new Bundle(); bundle.putString("name", "From Activity"); bundle.putInt("id", 4); FragmentA fragobjA = new FragmentA(); fragobjA.setArguments(bundle);
and this FragmentA
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_a, container, false); Bundle bundle = this.getArguments(); if (bundle != null) { nomor = bundle.getInt("id", 0); info= bundle.getString("name"); }; return rootView; } .....
error nomor and id value : null
MyActivity onCreate
and this FragmentA
error nomor and id value : null