I\'m trying to applicate drawernavigation (my first fragment is a map & the others are just some fragments with simple layouts).So it runs fine & I can navigate betw
Try to reuse/recycle your layout. I am running into "duplicate id" when using a map fragment. So in onCreateView instead of
final View rootView = inflater.inflate(R.layout.fragment_profile, container, false);
i am using
public class YourFragment extends Fragment {
public YourFragment(){}
...
private static View rootView;
...
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
//View rootView = inflater.inflate(R.layout.fragment_layout, container, false);
if (rootView != null) {
ViewGroup parent = (ViewGroup) rootView.getParent();
if (parent != null)
parent.removeView(rootView);
}
try {
rootView = inflater.inflate(R.layout.fragment_layout, container, false);
} catch (InflateException e) {
/* map is already there, just return view as it is */
}