我需要将 a 嵌入SupportMapFragment
到Dialog
. 这是我能想到的最好的:
public class SupportMapFragmentDialog extends DialogFragment {
private final SupportMapFragment fragment;
public SupportMapFragmentDialog() {
fragment = new SupportMapFragment();
setTargetFragment(fragment, 1);
}
@Override
public View onCreateView(final LayoutInflater inflater,
final ViewGroup container, final Bundle savedInstanceState) {
return fragment.onCreateView(inflater, container, savedInstanceState);
}
public SupportMapFragment getFragment() {
return fragment;
}
}
但是,当我这样称呼时:
final SupportMapFragmentDialog dialog = new SupportMapFragmentDialog();
dialog.show(getSupportFragmentManager(), "Historico");
我明白了:
我该怎么做才能在 Dialog 上查看地图?
该应用程序还有另一个SupportMapFragment
正在创造奇迹的应用程序,因此它与配置没有任何关系。