This is a canonical question for a problem frequently posted on StackOverflow. I'm following a tutorial. I've created a new activity using a wizard. I get NullPointerException when attempting to call...
I have seen two general practices to instantiate a new Fragment in an application: Fragment newFragment = new MyFragment(); and Fragment newFragment = MyFragment.newInstance(); The second option...
The activity hosting this fragment has its onActivityResult called when the camera activity returns. My fragment starts an activity for a result with the intent sent for the camera to take a picture....
I'm using a ViewPager together with a FragmentStatePagerAdapter to host three different fragments: [Fragment1] [Fragment2] [Fragment3] When I want to get Fragment1 from the ViewPager in the Fragme...
I am trying to create an ImageView in a Fragment which will refer to the ImageView element which I have created in the XML for the Fragment. However, the findViewById method only works if I extend an ...
I'm trying to use Fragment with a ViewPager using the FragmentPagerAdapter. What I'm looking for to achieve is to replace a fragment, positioned on the first page of the ViewPager, with another one. ...
I have found many instances of a similar question on SO but no answer unfortunately meets my requirements. I have different layouts for portrait and landscape and I am using back stack, which both pr...
Duplicate ID, tag null, or parent id with another fragment for com.google.android.gms.maps.MapFragment
I have an application with three tabs. Each tab has its own layout .xml file. The main.xml has its own map fragment. It's the one that shows up when the application first launches. Everything works ...
How can I pass data between a fragment and its container activity? Is there something similar to passing data between activities through intents? I read this, but it didn't help much: http://develope...
When I start an activity which implements viewpager, the viewpager created various fragments. I want to use different layouts for each fragment, but the problem is that viewpager shows only two layout...