Fragment_Map needs to inherit from FragmentActivity, assuming that Fragment_Map is supposed to be an activity.
On Mon, Jan 7, 2013 at 7:00 AM, John Spartan <[email protected]> wrote: > Hello everybody, > > i am not a specialist in android-development, please considerate. My Problem > is, to put the supportmapFragment in a Viewpage. > > when i write the following two methods in a Class names Fragment_Map extends > fragment, i get at the red marked text the error: The method > getSupportFragmentManager() is undefined for the type Fragment_Map > > > 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(); > > // > getSupportFragmentManager().findFragmentById(R.id.map)) > // .getMap(); > // // Check if we were successful in obtaining the map. > if (mMap != null) { > setUpMap(); > } > } > } > > private void setUpMap() { > mMap.addMarker(new MarkerOptions().position(new LatLng(0, > 0)).title("Marker")); > } > > > i got these methods from the Sample-Code. Can someone help me with this? i > dont know, how to implement this in a fragment. i get only errors. plz help > and thanks in advance > > PS: sry for my english :/ > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 4.5 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

