本文整理汇总了Java中com.google.android.gms.maps.MapView.onResume方法的典型用法代码示例。如果您正苦于以下问题:Java MapView.onResume方法的具体用法?Java MapView.onResume怎么用?Java MapView.onResume使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.maps.MapView
的用法示例。
在下文中一共展示了MapView.onResume方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createViewInstance
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
/**
* Implementation of the react create view instance method - returns the map view to react.
*
* @param context
* @return MapView
*/
@Override
protected MapView createViewInstance(ThemedReactContext context) {
mapView = new MapView(context);
mapView.onCreate(null);
mapView.onResume();
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
locationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
}
reactContext = context;
return mapView;
}
示例2: onCreateView
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.location_fragment, container, false);
mMapView = (MapView) rootView.findViewById(R.id.mapView);
mMapView.onCreate(savedInstanceState);
mMapView.onResume(); // needed to get the map to display immediately
try {
MapsInitializer.initialize(getActivity().getApplicationContext());
} catch (Exception e) {
e.printStackTrace();
}
mMapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap mMap) {
googleMap = mMap;
refreshMap(null);
}
});
return rootView;
}
示例3: onCreateView
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_detail_location, container, false);
mMapView = (MapView) root.findViewById(R.id.mapView);
mMapView.onCreate(savedInstanceState);
mMapView.onResume();
recycleView = (RecyclerView) root.findViewById(R.id.location_recycler_view);
locationAdapter = new LocationAdapter(getActivity());
recycleView.setAdapter(locationAdapter);
recycleView.setLayoutManager(new LinearLayoutManager(getActivity()));
return root;
}
示例4: onCreateView
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_map, container, false);
mapView = (MapView) v.findViewById(R.id.map);
mapView.onCreate(savedInstanceState);
mapView.onResume();// needed to get the googleMap to display immediately
try {
MapsInitializer.initialize(getActivity().getApplicationContext());
} catch (Exception e) {
e.printStackTrace();
}
mapView.getMapAsync(this);
progressBar = (ProgressBar) v.findViewById(R.id.progressBar);
emptyListTextView = (TextView) v.findViewById(R.id.emptyListText);
mapUpdateHandler = new Handler();
mapUpdater.run();
return v;
}
示例5: onCreateView
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
FrameLayout v = (FrameLayout) inflater.inflate(R.layout.fragment_map, container, false);
mapView = (MapView) v.findViewById(R.id.map);
mapView.onCreate(savedInstanceState);
mapView.onResume();
mapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap googleMap) {
Log.i("DevMsg", "Success!!!!!");
myMap = googleMap;
populateMap();
}
});
return v;
}
示例6: onResume
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
protected void onResume() {
super.onResume();
int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if (resultCode == ConnectionResult.SUCCESS) {
mRecyclerView.setAdapter(mListAdapter);
} else {
GooglePlayServicesUtil.getErrorDialog(resultCode, this, 1).show();
}
if (mListAdapter != null) {
for (MapView m : mListAdapter.getMapViews()) {
m.onResume();
}
}
}
示例7: setupMap
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
protected void setupMap(){
// GoogleMapOptions to Set Map to Lite Mode
GoogleMapOptions googleMapOptions = new GoogleMapOptions().liteMode(true);
mMapView = new MapView(this, googleMapOptions);
mMapView.setClickable(false);
mMapView.setLayoutParams(new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
mMapView.setMinimumHeight(MAP_HEIGHT);
mMapContainer.addView(mMapView);
mMapContainer.setMinimumHeight(MAP_HEIGHT);
mMapView.onCreate(null);
mMapView.onResume();
mMapView.getMapAsync(this);
}
示例8: onViewCreated
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mMapView = (MapView) view.findViewById(R.id.mapView);
mMapView.onCreate(savedInstanceState);
mMapView.onResume();
boolean isGooglePlayServicesAvailable = ConnectionResult.SUCCESS ==
GooglePlayServicesUtil.isGooglePlayServicesAvailable(getActivity());
if (isGooglePlayServicesAvailable) {
setMap();
} else {
mMapView.setVisibility(View.GONE);
}
ListView listViewContacts = (ListView) view.findViewById(R.id.listview_contacts);
listViewContacts.setAdapter(new ContactsAdapter(getActivity()));
}
示例9: onCreateView
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
if (view != null) {
ViewGroup parent = (ViewGroup) view.getParent();
if (parent != null)
parent.removeView(view);
}
view = inflater.inflate(R.layout.home_frg, container, false);
mMapView = (MapView) view.findViewById(R.id.mapView);
mMapView.onCreate(savedInstanceState);
mMapView.onResume();
try {
MapsInitializer.initialize(context.getApplicationContext());
} catch (Exception e) {
e.printStackTrace();
}
initViews(view);
return view;
}
示例10: onCreateView
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
setActionBar();
View view = inflater.inflate(R.layout.fragment_security, container, false);
autoBlip = (ToggleButton) view.findViewById(R.id.toggle_blip);
autoLocate = (ToggleButton) view.findViewById(R.id.toggle_locate);
wipe = (Button) view.findViewById(R.id.wipe);
wipeCache = (Button) view.findViewById(R.id.wipe_cache);
mapView = (MapView) view.findViewById(R.id.mapView);
mapView.onCreate(savedInstanceState);
mapView.onResume();
try {
MapsInitializer.initialize(getActivity().getApplicationContext());
} catch (Exception e) {
e.printStackTrace();
}
map = mapView.getMap();
setupMap();
setupListeners();
return view;
}
示例11: onCreateView
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_map, container, false);
mMapView = (MapView) rootView.findViewById(R.id.mapView);
mMapView.onCreate(savedInstanceState);
mMapView.onResume(); // needed to get the map to display immediately
try {
MapsInitializer.initialize(getActivity().getApplicationContext());
} catch (Exception e) {
e.printStackTrace();
}
mMapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap mMap) {
googleMap = mMap;
// For dropping a marker at a point on the Map
LatLng sydney = new LatLng(-34, 151);
googleMap.addMarker(new MarkerOptions().position(sydney).title("Marker Title").snippet("Marker Description"));
// For zooming automatically to the location of the marker
CameraPosition cameraPosition = new CameraPosition.Builder().target(sydney).zoom(12).build();
googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
}
});
return rootView;
}
示例12: onViewCreated
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mapView = (MapView) view.findViewById(R.id.map);
mapView.onCreate(savedInstanceState);
mapView.onResume();
mapView.getMapAsync(this);
}
示例13: buildMap
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
private void buildMap(View v, Bundle savedInstanceState) {
mMapView = (MapView) v.findViewById(R.id.mapView);
mMapView.onCreate(savedInstanceState);
mMapView.onResume();
try {
MapsInitializer.initialize(getActivity().getApplicationContext());
} catch (Exception e) {
e.printStackTrace();
}
mMapView.getMapAsync(this);
}
示例14: MapHeaderHolder
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
public MapHeaderHolder(View v) {
super(v);
mapView = (MapView) v;
// Call through onCreate and onResume because we had these already but the MapView did not yet exist then
mapView.onCreate(null);
mapView.onResume();
mapView.getMapAsync(googleMap -> googleMap.getUiSettings().setMapToolbarEnabled(false));
}
示例15: onCreateView
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_map, container, false);
mMapView = (MapView) view.findViewById(R.id.mv_map);
mMapView.onCreate(savedInstanceState);
mMapView.onResume();
mMapView.getMapAsync(this);
return view;
}