本文整理匯總了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();
}