Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Android 中的 Google 地图。它向服务器请求在标记上显示一些内容,现在我想在用户平移地图时终止挂起请求或所有请求的连接。
关闭底层InputStream这也将关闭连接。
InputStream
关于向某事(例如您的连接)提交请求,然后取消您可以检查ExecutorService界面的请求。它有execute()和shutdown()awaitTermination()
ExecutorService
execute()
shutdown()
awaitTermination()