Cómo obtener fragmentos del diseño inflado
Tengo diseño infladocontent_main.xml
aview
variablevi
¿Cómo debo obtener elfragment
desde esta vista inflada?
Tal vez algo como:
SupportMapFragment mapFragment = (SupportMapFragment) inflatedView.getSupportFragmentManager()
.findFragmentById(R.id.map);
public void getMapFragment()
{
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View vi = inflater.inflate(R.layout.content_main, null);
CoordinatorLayout mainL = (CoordinatorLayout) findViewById(R.id.main_view);
mainL.removeAllViews();
mainL.addView(vi);
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
¡Gracias por la respuesta!