小编Irw*_*ans的帖子

无法在Fragment中解析方法'getSupportFragmentManager()'

我发现消息无法解析方法'getSupportFragmentManager()'我想要片段化为活动.因为我想在选项卡上使用地图滑动.

public class PETAcikarangsukatani extends Fragment {
Context context;

private static final LatLng SUKATANI = new LatLng(-6.171327, 107.178108);
private static final LatLng WRPOJOK = new LatLng(-6.222411, 107.162158);
private static final LatLng PILAR = new LatLng(-6.257033, 107.156472);
private static final LatLng CIKARANG = new LatLng(-6.256073, 107.143984);


GoogleMap googleMap;
final String TAG = "PathGoogleMapActivity";

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.activity_path_google_map, container, false);
    context = rootView.getContext();

    SupportMapFragment fm = (SupportMapFragment)getSupportFragmentManager()
            .findFragmentById(R.id.map);
    googleMap = fm.getMap();
Run Code Online (Sandbox Code Playgroud)

android google-maps fragment android-fragments

43
推荐指数
7
解决办法
10万
查看次数