java - How to use getSupportFragmentManager() inside MainActivity class which extends MapActivity -


i trying use getsupportfragmentmanager() inside mainactivity class extends mapactivity getting following error unable resolve.

"the method getsupportfragmentmanager() undefined type mainactivity"

previously extending fragmentactivity , working fine want add mapoverlay why extending mapactivity.

here portion of associated code

public class mainactivity extends mapactivity {    googlemap googlemap;   markeroptions markeroptions;   latlng latlng;   geocoder geocoder;   edittext edittext;   geopoint p;   mapcontroller controller;   mapview mapview;   button btnsearch;         @override       protected void oncreate(bundle savedinstancestate) {        super.oncreate(savedinstancestate);        setcontentview(r.layout.activity_main);         int status = googleplayservicesutil                 .isgoogleplayservicesavailable(getbasecontext());      if (status != connectionresult.success) {         // google play services not available          int requestcode = 10;         dialog dialog = googleplayservicesutil.geterrordialog(status, this,                 requestcode);         dialog.show();      }       else {          // getting reference supportmapfragment         supportmapfragment fragment = (supportmapfragment) getsupportfragmentmanager().findfragmentbyid(r.id.map);         // getting google map         googlemap = fragment.getmap();         mapview mapview = (mapview) findviewbyid(r.id.mapview);         addlisteneronbutton();     }  } 


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -