当前位置: 首页>>代码示例>>Java>>正文


Java MapView.onCreate方法代码示例

本文整理汇总了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);
}
 
开发者ID:CMPUT301F17T09,项目名称:GoalsAndHabits,代码行数:23,代码来源:MyHabitsMapActivity.java

示例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;
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:19,代码来源:ChallengeSenderFragment.java

示例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;
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:19,代码来源:RunningMapFragment.java

示例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;
}
 
开发者ID:danthedrummer,项目名称:HuddlOut_client,代码行数:22,代码来源:MapFragment.java

示例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;
}
 
开发者ID:Pod-Point,项目名称:react-native-maps,代码行数:22,代码来源:PPTGoogleMapManager.java

示例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;
}
 
开发者ID:gautamgitspace,项目名称:CellularNetworkMonitor,代码行数:26,代码来源:MapFragment.java

示例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;
}
 
开发者ID:nvh0412,项目名称:dealhunting,代码行数:19,代码来源:DetailLocationFragment.java

示例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);
}
 
开发者ID:MarcProe,项目名称:lp2go,代码行数:18,代码来源:ViewControllerMap.java

示例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);
    }
 
开发者ID:mojosoeun,项目名称:Runch,代码行数:23,代码来源:RestaurantInfoViewHolder.java

示例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;
}
 
开发者ID:mojo1643,项目名称:margarita,代码行数:23,代码来源:LocationFragment.java

示例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);
}
 
开发者ID:foxtrot94,项目名称:DotHike,代码行数:20,代码来源:ResultsActivity.java

示例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;
}
 
开发者ID:Preston-Landers,项目名称:QuietPlaces,代码行数:25,代码来源:QPMapFragment.java

示例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()));
}
 
开发者ID:CheDream-Android,项目名称:CheDream,代码行数:21,代码来源:ContactsFragment.java

示例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;
}
 
开发者ID:cartermp,项目名称:WMB,代码行数:27,代码来源:RouteMapFragment.java

示例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;
}
 
开发者ID:ngageoint,项目名称:disconnected-content-explorer-android,代码行数:22,代码来源:ReportMapFragment.java


注:本文中的com.google.android.gms.maps.MapView.onCreate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。