本文整理汇总了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();
}
}
示例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);
}
示例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();
}
示例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;
}
示例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();
}