本文整理匯總了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;
}