Java异常来自哪里?(Where do Java exceptions came from?)
到目前为止,我认为必须由构造函数在某处创建每个Java异常,因为我可以自己创建自定义异常:
throw new Exception();
但现在看来我必须处理来自JavaMail的一些异常 - MessagingException 。 它来自
Store.close
方法(继承自Service
类)。我去了那里(我需要检查什么时候抛出这个异常所以我知道什么是错的)我看到这个方法调用了另外两个方法 - 它们都没有抛出异常!
public synchronized void close() throws MessagingException { setConnected(false); notifyConnectionListeners(ConnectionEvent.CLOSED); }
据我所知,这是检查Exception(既不是Error也不是RuntimeException),那么怎么可能不必在
close
方法命令中使用它? 在这种方法中也没有创建它。Until now, I thought that every Java exception has to be created somewhere by a constructor, as I can create on my own, custom exceptions:
throw new Exception();
But now it seems that I have to handle some exception from JavaMail - MessagingException. It comes from the method
Store.close
(inherited fromService
class).I went there (I need to check when this exception is thrown so I know what can be wrong) and I see that this method calls two other methods - none of them throw an exception!
public synchronized void close() throws MessagingException { setConnected(false); notifyConnectionListeners(ConnectionEvent.CLOSED); }
As far as I understand, this is checked Exception (neither Error nor RuntimeException), so how is it possible that it doesn't have to be declared in any of used by
close
method commands? It is also not created here, in this method.
原文:https://stackoverflow.com/questions/43998873
最满意答案
您需要为此使用Places API 。
需要做poi.park visiblity关闭。
您可以在此处查看所有支持的地点类型。
要查看如何在Android中使用Places API,您可以查看此链接 。
You would need to use Places API for this.
Would need to do poi.park visiblity turn off.
You can see all of the supported places type here.
To see how to use Places API in Android, you can check this link out.
相关问答
更多-
您需要为此使用Places API 。 需要做poi.park visiblity关闭。 您可以在此处查看所有支持的地点类型。 要查看如何在Android中使用Places API,您可以查看此链接 。 You would need to use Places API for this. Would need to do poi.park visiblity turn off. You can see all of the supported places type here. To see how to ...
-
您需要执行以下操作,如此JsFiddle所示,其中包含大量冗余代码 一旦地图对象在那里。 用你的所有标记填充它 当有人点击过滤器时(例如在我的小提琴中点击汽车或人),它将清除地图并从无序列表中重绘标记仅供人使用。 该功能不会改变你缩放或平移的位置,但你可以轻松地做到这一点。 没有第3步。也许你希望它们回到原始地图上的所有对象,所以放置一个显示所有标记的功能。 过滤的实际代码是: {clear:{}}, { action: 'addMarkers', marker:{ values:ulmarkerspeop ...
-
Google代码上的InfoBox库不再以可链接的形式提供。 该库已被移至GitHub 。 请参阅此相关问题: Google Maps API V3 Infobox.js已删除 更新小提琴 链接到github版本的代码片段: var map; var markers = []; var content = []; var map = new google.maps.LatLng(46.2171749, 7.5984075); var bounds = new google.maps.LatLngBo ...
-
谷歌地图API v3标记除了图标之外是不同的,为什么?(Google Maps API v3 Markers are different except icons, why?)[2022-02-20]
工作示例(带功能关闭) function codeAddressES(){ codeAddress("BN1 3EL","Title1","Here1", "Red"); codeAddress("BN1 4QU","Title2","Here2", "Yellow"); codeAddress("BN1 3DL","Title3","Here3", "Blue"); } function codeAddress(address,title,pt ... -
添加多个不同的复杂图标和信息框到谷歌地图api V3(Add multiple different complex icons AND info boxes to google maps api V3)[2022-06-09]
您可以创建一个json对象的json对象,您可以在其中保留自定义图像。 像这样的东西 customImgObj = { 'family' : {'image' : YOUR_IMAGE_GOES_HERE, 'shadow' : YOUR_SHADOW_GOES_HERE}, 'couples' : {'image' : YOUR_IMAGE_GOES_HERE, 'shadow' : YOUR_SHADOW_GOES_HERE}, 'other' : {'image' : Y ... -
我认为你不能改变地图api上的默认UI控件。 但是,你能做的是: 从地图中删除缩放控件, 请参见此处 var mapOptions = { zoomControl: false } 添加这样的自定义控件并在自定义控件上实现放大和缩小功能(使用setZoom(zoom:number)功能) I don't think you can change the default UI controls on the maps api. However, what you can do is: Remove the z ...
-
如果它在Android手机上运行,那么它应该可以工作。 您可能没有安装Google Play服务安装了您正在测试的Android模拟器。 此外,对于Android播放器,这些设备通常不带有GPS芯片,甚至不包括谷歌Nexus播放器。 After a long research, I found some solution for my problem. I tried using Genymotion emulator, which seems to be the best emulator for tes ...
-
过滤标记谷歌地图(Filtering Markers Google Maps)[2023-08-01]
var markers = []; // declare a array of markers (Global here...) for ( var index in) { var marker = new google.maps.Marker({ position : new google.maps.LatLng( ), map : , ... -
如何在谷歌地图android上的两个位置缩放设置一个良好的距离(How to set a good distance in zoom of two locations on google maps android)[2023-08-07]
你应该使用LatLngBounds 。 LatLngBounds.Builder builder = new LatLngBounds.Builder(); // Add your locations to bounds using builder.include, maybe in a loop LatLngBounds bounds = builder.build(); //Then construct a cameraUpdate CameraUpdate cameraUpdate = CameraU ... -
如何在Google Maps V3中显示具有不同图标的多个标记(How to display multiple markers with different icons in Google Maps V3)[2022-01-13]
首先,这不是一个真正的问题但是不合适:更改var logoControl = new MyLogoControl(logoControlDiv); to var logoControl = MyLogoControl(logoControlDiv); 因为MyLogoControl不会返回新对象,所以不需要'new'关键字。 现在,在那里(在您已链接到此处的测试页面上),您必须删除以下内容: var map = new google.maps.Map(document.getElementById("map ...