當前位置: 首頁>>代碼示例>>Java>>正文


Java MapView.onResume方法代碼示例

本文整理匯總了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;
}
 
開發者ID:Pod-Point,項目名稱:react-native-maps,代碼行數:22,代碼來源:PPTGoogleMapManager.java

示例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;
}
 
開發者ID:gautamgitspace,項目名稱:CellularNetworkMonitor,代碼行數:26,代碼來源:MapFragment.java

示例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;
}
 
開發者ID:nvh0412,項目名稱:dealhunting,代碼行數:19,代碼來源:DetailLocationFragment.java

示例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;
}
 
開發者ID:Gaso-UFS,項目名稱:gaso,代碼行數:27,代碼來源:MapGasoFragment.java

示例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;
}
 
開發者ID:danthedrummer,項目名稱:HuddlOut_client,代碼行數:22,代碼來源:MapFragment.java

示例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();
        }
    }
}
 
開發者ID:mojosoeun,項目名稱:Runch,代碼行數:19,代碼來源:RestaurantInfoActivity.java

示例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);
}
 
開發者ID:foxtrot94,項目名稱:DotHike,代碼行數:20,代碼來源:ResultsActivity.java

示例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()));
}
 
開發者ID:CheDream-Android,項目名稱:CheDream,代碼行數:21,代碼來源:ContactsFragment.java

示例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;
}
 
開發者ID:liyaguang,項目名稱:PalHunterClient,代碼行數:23,代碼來源:HomeFragment.java

示例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;
}
 
開發者ID:rachitmishra,項目名稱:ceeq,代碼行數:26,代碼來源:SecurityFragment.java

示例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;
}
 
開發者ID:doljko,項目名稱:youth-health,代碼行數:33,代碼來源:MapFragment.java

示例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);
}
 
開發者ID:mremondi,項目名稱:Hyke,代碼行數:9,代碼來源:NearMeFragment.java

示例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);
}
 
開發者ID:cscd-488,項目名稱:event-app,代碼行數:14,代碼來源:LocationMapFragment.java

示例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));
}
 
開發者ID:erickok,項目名稱:ratebeer,代碼行數:9,代碼來源:LocalPlacesAdapter.java

示例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;
}
 
開發者ID:jmarkstar,項目名稱:TuristHelper,代碼行數:12,代碼來源:GoogleMapFragment.java


注:本文中的com.google.android.gms.maps.MapView.onResume方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。