In simple positioning of Android Google Maps (1), we have obtained world maps. In fact, we have a lineCodeI haven't written it yet. If I add some code in mainactivity, we can simply locate it ~~~
1,Source code(The code is added on the basis of the previous code, if you do not know how to get the world map, see the http://blog.csdn.net/woshishuoshuoa/article/details/9774491)
2. Note: supportmapfragment is suitable for versions earlier than API 12. It must inherit fragmentactivity from activity; mpafragment is suitable for Versions later than API 12, and class = "com. google. android. GMS. maps. supportmapfragment "/> inherits the activity.
For example, retrieve GoogleMap map = (supportmapfragment) getsupportfragmentmanager (). findfragmentbyid (R. Id. Map). getmap () below map object API 12 ();
GoogleMap map = (mapfragment) getfragmentmanager (). findfragmentbyid (R. Id. Map). getmap ();
3. Running result:
This article is just a simple implementation of the positioning, relatively simple, hope that Android users like to propose a better idea to share Oh ~~~ If you need to repost this article, please indicate the source. Although this article is relatively simple, it can also be copyrighted ~~~ Thank you for your comments ~~~ If you are interested, read http://blog.csdn.net/woshishuoshuoa/article/details/9793327.