本文整理汇总了Java中com.google.android.gms.maps.MapView.onCreate方法的典型用法代码示例。如果您正苦于以下问题:Java MapView.onCreate方法的具体用法?Java MapView.onCreate怎么用?Java MapView.onCreate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.maps.MapView
的用法示例。
在下文中一共展示了MapView.onCreate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
/**
* Called on activity start. Generates layout and button functionality.
* @param savedInstanceState
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_habits_map);
events = (ArrayList<HabitEvent>) getIntent().getSerializableExtra("event list");
if (events==null || events.size()<1){finish();}
Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar);
toolbar.setTitle("Map of My Habit History");
toolbar.setNavigationIcon(R.drawable.ic_close_button);
setSupportActionBar(toolbar);
map = (MapView) findViewById(R.id.myHabitsMap);
map.onCreate(savedInstanceState);
map.getMapAsync(this);
}
示例2: onCreateView
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_challenge_sender, container, false);
mapView = (MapView) view.findViewById(R.id.mapView);
mapView.onCreate(savedInstanceState);
mapView.getMapAsync(this);
googleApiClient = ((ChallengeActivity)getActivity()).getGoogleApiClient();
locationSettingsHandler = ((ChallengeActivity)getActivity()).getLocationSettingsHandler();
distance = (TextView) view.findViewById(R.id.sender_distance);
String userName = ((AppRunnest)getActivity().getApplication()).getUser().getName();
run = new Run(userName);
return view;
}
示例3: 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
View view = inflater.inflate(R.layout.fragment_running_map, container, false);
// Buttons
GUISetup(view);
mapView = (MapView) view.findViewById(R.id.mapView);
mapView.onCreate(savedInstanceState);
mapView.getMapAsync(this); //this is important
// Location
setupLocation();
return view;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: init
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public void init() {
super.init();
mMapView = (MapView) findViewById(R.id.map);
mMapHelper = new MapHelper(getMainActivity());
if (mMapView != null) {
mMapView.onCreate(null);
mMapView.getMapAsync(mMapHelper);
}
txtLatitude = (TextView) findViewById(R.id.txtLatitude);
txtLongitude = (TextView) findViewById(R.id.txtLongitude);
txtMapGPS = (TextView) findViewById(R.id.txtMapGPS);
txtMapGPSSatsInView = (TextView) findViewById(R.id.txtMapGPSSatsInView);
}
示例9: RestaurantInfoViewHolder
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
public RestaurantInfoViewHolder(Context context, View view) {
super(view);
mContext = context;
recommend_msg = (TextView)view.findViewById(R.id.recommend_restaurant_comment);
name = (TextView) view.findViewById(R.id.restaurant_name);
meta = (TextView) view.findViewById(R.id.restaurant_meta);
addr = (TextView) view.findViewById(R.id.address);
phoneNum = (TextView)view.findViewById(R.id.phone_number);
rating = (TextView)view.findViewById(R.id.rating);
ratingBar = (RatingBar)view.findViewById(R.id.ratingBar);
mapView = (MapView) view.findViewById(R.id.map);
recommend_msg.setVisibility(View.GONE);
meta.setVisibility(View.GONE);
ratingBar.setStepSize((float)0.5);
ratingBar.setIsIndicator(false);
mapView.onCreate(null);
mapView.getMapAsync(this);
}
示例10: onCreateView
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.location_fragment, container, false);
// Gets the MapView from the XML layout and creates it
mapView = (MapView) view.findViewById(R.id.map);
mapView.onCreate(savedInstanceState);
// Gets to GoogleMap from the MapView and does initialization stuff
map = mapView.getMap();
map.getUiSettings().setMyLocationButtonEnabled(false);
map.setMyLocationEnabled(true);
// Needs to call MapsInitializer before doing any CameraUpdateFactory calls
MapsInitializer.initialize(this.getActivity());
map.setOnMarkerDragListener(this);
mNetworkConnection = new NetworkConnection(getActivity());
mLocationProvider = new LocationProvider(getActivity(), this);
return view;
}
示例11: 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);
}
示例12: 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);
if (rootView == null) {
Log.e(TAG, "rootView is null in onCreateView in QPMapFragment");
return null;
}
MapsInitializer.initialize(getMyActivity());
mMapView = (MapView) rootView.findViewById(R.id.map);
if (mMapView != null) {
mMapView.onCreate(mBundle);
setUpMapIfNeeded(rootView);
}
MainActivity mainActivity = (MainActivity) getActivity();
CheckBox followingUserCB = (CheckBox) rootView.findViewById(R.id.follow_user_checkBox);
followingUserCB.setChecked(mainActivity.isFollowingUser());
return rootView;
}
示例13: 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()));
}
示例14: onCreateView
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
Bundle args = getArguments();
setUpBundleArgs(args);
View v = inflater.inflate(R.layout.fragment_route_map, container, false);
if (v != null) {
mapView = (MapView) v.findViewById(R.id.map);
if (mapView != null) {
mapView.onCreate(savedInstanceState);
}
}
MapsInitializer.initialize(this.getActivity());
route = getRoute();
setupMapIfNeeded(fromStop);
return v;
}
示例15: onCreateView
import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.fragment_report_map, container, false);
mapView = (MapView) view.findViewById(R.id.map);
mapView.onCreate(savedInstanceState);
mapView.getMapAsync(this);
mapOverlaysView = view.findViewById(R.id.mapOverlays);
ImageButton mapOverlaysButton = (ImageButton) mapOverlaysView
.findViewById(R.id.mapOverlaysButton);
mapOverlaysButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(getActivity(), OverlaysActivity.class);
getActivity().startActivityForResult(intent, ReportCollectionActivity.OVERLAYS_ACTIVITY);
}
});
return view;
}