{"id":6353,"date":"2014-04-17T00:56:44","date_gmt":"2014-04-17T00:56:44","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/17\/android-supportmapfragment-the-method-findviewbyidint-is-undefined-for-the-type-collection-of-common-programming-errors\/"},"modified":"2014-04-17T00:56:44","modified_gmt":"2014-04-17T00:56:44","slug":"android-supportmapfragment-the-method-findviewbyidint-is-undefined-for-the-type-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/17\/android-supportmapfragment-the-method-findviewbyidint-is-undefined-for-the-type-collection-of-common-programming-errors\/","title":{"rendered":"Android [SupportMapFragment] The method findViewById(int) is undefined for the type-Collection of common programming errors"},"content":{"rendered":"<pre><code>public class PlaceMapsFragment extends SupportMapFragment {\n    private GoogleMap mMap;\n\n    @Override\n    public View onCreateView(LayoutInflater inflater, ViewGroup container,\n            Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        View v = inflater.inflate(R.layout.fragment_place_maps, container,\n                false);\n\n\n        setUpMapIfNeeded();\n        return v;\n    }\n\n    private void setUpMapIfNeeded() {\n        if (mMap == null) {\n            mMap = ((MapView) findViewById(R.id.map)).getMap();\n            if (mMap != null) {\n                setUpMap();\n            }\n        }\n    }\n\n    private void setUpMap() {\n        mMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title(\n                \"Marker\"));\n    }\n}\n<\/code><\/pre>\n<p><strong>Error<\/strong><\/p>\n<pre><code>The method findViewById(int) is undefined for the type PlaceMapsFragment\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>public class PlaceMapsFragment extends SupportMapFragment { private GoogleMap mMap; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreate(savedInstanceState); View v = inflater.inflate(R.layout.fragment_place_maps, container, false); setUpMapIfNeeded(); return v; } private void setUpMapIfNeeded() { if (mMap == null) { mMap = ((MapView) findViewById(R.id.map)).getMap(); if (mMap != null) { setUpMap(); } } } private void setUpMap() [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6353","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6353"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6353\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}