0

I have an FragmentActivity which has a SupportMapFragment. I want to add buttons, menus (slide menu)...how could I do this?

here is my code:

public class MapsActivity extends FragmentActivity {

private GoogleMap mMap; // Might be null if Google Play services APK is not available.
private LocalizeDB db;


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    setUpMapIfNeeded();
    db = new LocalizeDB(this);
}



 @Override
    protected void onResume() {
        super.onResume();
        setUpMapIfNeeded();
    }


 private void setUpMapIfNeeded() {
    // Do a null check to confirm that we have not already instantiated the map.
    if (mMap == null) {
        // Try to obtain the map from the SupportMapFragment.
        mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
        // Check if we were successful in obtaining the map.
        if (mMap != null) {
            setUpMap();
        }
    }
}
Ladessa
  • 985
  • 4
  • 24
  • 50

1 Answers1

0

FragmentActivity is a subclass of Activity. Most of all things you do with an Activity you can do with a FragmentActivity (some differences are stated here).

I think you will use your activity_maps layout to place additional buttons. The slide menu may be implemented as a Navigation Drawer. Let me know if I've missed something.

Hope it helps!

Community
  • 1
  • 1
ARNeto
  • 441
  • 4
  • 8