I have a feeling it has to do something with the fragment or my activity's lifecycle methods but I honestly do not even know where to begin. I understand how the lifecycles flow but as for putting code into these methods to fix this issue I do not even know where to begin. The only methods so far I have used/Override with my code in it is the "onCreate()" in my Activity and "onCreateView()" in my fragments. Does anyone have a solution as to why it is doing this?
This Log.i code snippet here is when I go from Activity (MainActivity) -> ListFragment (JungleListFragment) -> Fragment (JungleInfo)
- Code: Select all
10-01 05:10:25.734: I/MainActivity(712): onCreate
10-01 05:10:26.564: I/MainActivity(712): onStart
10-01 05:10:26.564: I/MainActivity(712): onResume
10-01 05:10:29.304: I/JungleListFragment(712): onAttach
10-01 05:10:29.304: I/JungleListFragment(712): onCreateView
10-01 05:10:29.344: I/JungleListFragment(712): onActivityCreated
10-01 05:10:31.234: I/JungleListFragment(712): onDestroyView
10-01 05:10:31.234: I/JungleInfo(712): onAttach
10-01 05:10:31.234: I/JungleInfo(712): onCreate
10-01 05:10:31.234: I/JungleInfo(712): onCreateView
10-01 05:10:31.664: I/JungleInfo(712): onActivityCreated
Now I just went and changed the devices font size and then re-entered my app and this is what I get:
- Code: Select all
10-01 05:14:06.783: I/JungleInfo(712): onPause
10-01 05:14:06.783: I/MainActivity(712): onPause
10-01 05:14:08.463: I/MainActivity(712): onStop
10-01 05:14:24.653: I/JungleInfo(712): onDestroyView
10-01 05:14:24.693: I/MainActivity(712): onDestroy
10-01 05:14:24.733: I/JungleListFragment(712): onAttach
10-01 05:14:24.733: I/JungleInfo(712): onAttach
10-01 05:14:24.733: I/JungleInfo(712): onCreate
10-01 05:14:24.733: I/MainActivity(712): onCreate
10-01 05:14:25.423: I/JungleInfo(712): onCreateView
10-01 05:14:25.563: D/AndroidRuntime(712): Shutting down VM
10-01 05:14:25.643: W/dalvikvm(712): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
10-01 05:14:25.743: E/AndroidRuntime(712): FATAL EXCEPTION: main
10-01 05:14:25.743: E/AndroidRuntime(712): java.lang.RuntimeException: Unable to start activity ComponentInfo{(*packageinfo*).MainActivity}: java.lang.NullPointerException
Hope this may help find a solution as to why it is doing this cause I am just completely lost.

