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


Java GooglePlayServicesNotAvailableException.printStackTrace方法代碼示例

本文整理匯總了Java中com.google.android.gms.common.GooglePlayServicesNotAvailableException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java GooglePlayServicesNotAvailableException.printStackTrace方法的具體用法?Java GooglePlayServicesNotAvailableException.printStackTrace怎麽用?Java GooglePlayServicesNotAvailableException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.android.gms.common.GooglePlayServicesNotAvailableException的用法示例。


在下文中一共展示了GooglePlayServicesNotAvailableException.printStackTrace方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入方法依賴的package包/類
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	
	// Log event
	Log.d(LOG_MAP_TAG, "MapActivity : onCreate() called.");
	
	// Set the content view with a google map fragment
	setContentView(R.layout.map_activity_main);
	
	// Create the fragments for the UI
	MapActivityEventListener eventListener = new MapActivityEventListener(this);
	gmapFragment = ((GoogleMapFragment) getFragmentManager().findFragmentById(R.id.map_fragment_googlemapfragment));
	gmapFragment.setGMapFragmentLoadedListener(eventListener);
	buildingFragment = new BuildingListDialog();
	buildingFragment.setOnBuildingSelectedListener(eventListener);
	
	// Prepare MapData
	mpd = new MapData(this);
	
	// Initialize the gms maps services
	try {
		MapsInitializer.initialize(this);
	} catch (GooglePlayServicesNotAvailableException e) {
		e.printStackTrace();
	}
}
 
開發者ID:Purdue-ACM-SIGAPP,項目名稱:Purdue-App-Old,代碼行數:27,代碼來源:MapActivity.java

示例2: showMap

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入方法依賴的package包/類
private void showMap(Bundle savedInstanceState) {
  try {
    MapsInitializer.initialize(getBaseContext());
  } catch (GooglePlayServicesNotAvailableException e) {
    e.printStackTrace();
  }
  GoogleMapOptions options = new GoogleMapOptions();
  options.mapType(GoogleMap.MAP_TYPE_NORMAL);
  options.zoomControlsEnabled(true);
  mapView = new MapView(this, options);
  mapView.onCreate(savedInstanceState);
  mapView.onResume();
  mapView.setEnabled(true);
  googleMap = mapView.getMap();
  if (googleMap != null) {
    googleMap.setMyLocationEnabled(true);
  }
  mapLayout.addView(mapView);
}
 
開發者ID:eggheadcreative,項目名稱:GeoFencingDemo,代碼行數:20,代碼來源:LocationActivity.java

示例3: onActivityCreated

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入方法依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState) {
	super.onActivityCreated(savedInstanceState);
	try {
		initializeMap();
	} catch (GooglePlayServicesNotAvailableException e) {
		e.printStackTrace();
	}
	setTitle();

}
 
開發者ID:himanshuagarwal77225,項目名稱:BookMySkills,代碼行數:12,代碼來源:MyHomeFragment.java

示例4: onCreateView

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
	// Inflate the layout containing a title and body text.
	ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.view_report,
			container, false);
	mView = new ViewReportView(rootView, getActivity());

	mReports = new ListReportModel();
	mView.mMapView.onCreate(savedInstanceState);
	if (mCategoryId > 0) {
		mReports.loadReportByCategory(mCategoryId);
	} else {
		mReports.load();
	}

	// Get GoogleMap from MapView
	mMap = mView.mMapView.getMap();

	try {
		MapsInitializer.initialize(getActivity());
	} catch (GooglePlayServicesNotAvailableException e) {
		e.printStackTrace();
	}

	// Initialize views with report data. This also handles map
	// initialization
	initReport(mPageNumber);
	fetchComments();

	// Set the title view to show the page number.

	mView.setPageIndicator(getString(R.string.title_template_step,
			mPageNumber + 1, mReports.getReports().size()));

	return rootView;
}
 
開發者ID:ais-albania,項目名稱:ZalartAndroid,代碼行數:38,代碼來源:ViewReportFragment.java

示例5: onMapReady

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入方法依賴的package包/類
public void onMapReady() {
	
	initPosition=new LatLng(-4.257399,15.283935);
	
	gmap=mapv.getMap();
	gmap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
	gmap.getUiSettings().setCompassEnabled(true);
	try{
		MapsInitializer.initialize(this.getSherlockActivity());
	}catch(GooglePlayServicesNotAvailableException e){
		e.printStackTrace();
	}
	//Move the camera instantly to initial position with a zoom of 17.
	gmap.moveCamera(CameraUpdateFactory.newLatLngZoom(initPosition, 30));
	// Zoom in, animating the camera.

	gmap.animateCamera(CameraUpdateFactory.zoomTo(30), 200, null); 
	//Initialize the marker
	marker=gmap
			.addMarker(new MarkerOptions()
			.title("Brazzaville")
			.visible(true).position(initPosition)
			.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_action_location)));

	gmap.animateCamera(CameraUpdateFactory.zoomTo(12), 2000, null); 

	setUpMap();

}
 
開發者ID:JCERTIFLab,項目名稱:jcertif-android-2013,代碼行數:30,代碼來源:MapEventFragment.java


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