[問題] Activty send data to Fragment
Activity code
Intent i = new Intent();
Bundle bundle =new Bundle();
bundle.putString("test", "test");
i.putExtras(bundle);
Fragment code
Bundle bundle =new Bundle();
bundle= getActivity().getIntent().getExtras();
String test= bundle.getString("test");
為何會空值 java.lang.NullPointerException
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.230.70.181
→
02/04 15:02, , 1F
02/04 15:02, 1F
推
02/04 16:42, , 2F
02/04 16:42, 2F
推
02/04 16:54, , 3F
02/04 16:54, 3F
推
02/08 23:54, , 4F
02/08 23:54, 4F
推
02/09 17:36, , 5F
02/09 17:36, 5F
推
02/24 03:12, , 6F
02/24 03:12, 6F