Search in sources :

Example 11 with MapFragment

use of com.google.android.gms.maps.MapFragment in project cw-omnibus by commonsguy.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (readyToGo()) {
        setContentView(R.layout.activity_main);
        MapFragment mapFrag = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
        if (savedInstanceState == null) {
            needsInit = true;
        }
        mapFrag.getMapAsync(this);
    }
}
Also used : MapFragment(com.google.android.gms.maps.MapFragment)

Example 12 with MapFragment

use of com.google.android.gms.maps.MapFragment in project cw-omnibus by commonsguy.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (readyToGo()) {
        setContentView(R.layout.activity_main);
        MapFragment mapFrag = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
        if (savedInstanceState == null) {
            needsInit = true;
        }
        mapFrag.getMapAsync(this);
    }
}
Also used : MapFragment(com.google.android.gms.maps.MapFragment)

Example 13 with MapFragment

use of com.google.android.gms.maps.MapFragment in project cw-omnibus by commonsguy.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (readyToGo()) {
        setContentView(R.layout.activity_main);
        MapFragment mapFrag = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
        if (savedInstanceState == null) {
            needsInit = true;
        }
        mapFrag.setRetainInstance(true);
        mapFrag.getMapAsync(this);
    }
}
Also used : MapFragment(com.google.android.gms.maps.MapFragment)

Example 14 with MapFragment

use of com.google.android.gms.maps.MapFragment in project cw-omnibus by commonsguy.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (readyToGo()) {
        setContentView(R.layout.activity_main);
        MapFragment mapFrag = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
        if (savedInstanceState == null) {
            needsInit = true;
        }
        mapFrag.getMapAsync(this);
    }
}
Also used : MapFragment(com.google.android.gms.maps.MapFragment)

Example 15 with MapFragment

use of com.google.android.gms.maps.MapFragment in project cw-omnibus by commonsguy.

the class MainActivity method onCreateForRealz.

private void onCreateForRealz(boolean canGetLocation) {
    if (canGetLocation) {
        if (readyToGo()) {
            setContentView(R.layout.activity_main);
            MapFragment mapFrag = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
            mapFrag.getMapAsync(this);
        }
    } else if (!isInPermission) {
        isInPermission = true;
        ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.ACCESS_FINE_LOCATION }, REQUEST_PERMS);
    }
}
Also used : MapFragment(com.google.android.gms.maps.MapFragment)

Aggregations

MapFragment (com.google.android.gms.maps.MapFragment)16 Intent (android.content.Intent)1 GoogleMap (com.google.android.gms.maps.GoogleMap)1 LatLng (com.google.android.gms.maps.model.LatLng)1 MarkerOptions (com.google.android.gms.maps.model.MarkerOptions)1