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() {
mMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title(
"Marker"));
}
}
错误
The method findViewById(int) is undefined for the type PlaceMapsFragment