SupportMapFragment Instead of MapFragment

时间秒杀一切 提交于 2019-11-30 23:59:46

Is there a way of doing things like, "add marker", "show my current location", and "take position of the point that I clicked"? (using SupportMapFragment, of course. )

Yes.

Step #1: Add the Android Support package to your app.

Step #2: Have your activities inherit from FragmentActivity from the Android Support package.

Step #3: Change all MapFragment references (Java code and layout XML resources) to SupportMapFragment.

And you're done.

All of my Maps V2 samples use SupportMapFragment, in conjunction with ActionBarSherlock (which is why you will see SherlockFragmentActivity as opposed to FragmentActivity.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!