I'm trying to create a mapFragment inside a view flipper. I have tried several approaches to it and cannot get it to work. so far I have tried:
- Declaring the fragment in the right part of the view flipper and accessing it there. The problem with this is that the view isn't loaded until it is switched into so the map doesn't exist and it creates a null pointer error when I try to access it.
- My second approach was declaring a map fragment progromatically and then inserting it into a FrameLayout container using fragment transactions.
- The third thing I tried was loading a fragment from an external file and inserting it into the container using a fragment transaction.
All of these were tried in the onCreate
and the call that caused them to throw a null pointer exception was inside the onResume
method. I would appreciate it if anyone has experienced this behavior before and knows how to fix it.