I have inflated layout content_main.xml
to view
variable vi
How should I get the fragment
from this inflated view?
Maybe something like :
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);
}
Thank you for the answer!