本文整理了Java中android.location.Address.getThoroughfare()
方法的一些代码示例,展示了Address.getThoroughfare()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.getThoroughfare()
方法的具体详情如下:
包路径:android.location.Address
类名称:Address
方法名:getThoroughfare
暂无
代码示例来源:origin: square/assertj-android
public AddressAssert hasThoroughfare(String thoroughfare) {
isNotNull();
String actualThoroughfare = actual.getThoroughfare();
assertThat(actualThoroughfare) //
.overridingErrorMessage("Expected thoroughfare <%s> but was <%s>.", thoroughfare,
actualThoroughfare) //
.isEqualTo(thoroughfare);
return this;
}
代码示例来源:origin: com.squareup.assertj/assertj-android
public AddressAssert hasThoroughfare(String thoroughfare) {
isNotNull();
String actualThoroughfare = actual.getThoroughfare();
assertThat(actualThoroughfare) //
.overridingErrorMessage("Expected thoroughfare <%s> but was <%s>.", thoroughfare,
actualThoroughfare) //
.isEqualTo(thoroughfare);
return this;
}
代码示例来源:origin: sephiroth74/Android-Exif-Extended
if( null != result.getThoroughfare() ) {
finalString.append( result.getThoroughfare() );
代码示例来源:origin: stackoverflow.com
try {
Geocoder geocoder = new Geocoder(this, Locale.getDefault());
List<Address> addressList = geocoder.getFromLocation(latitude, longitude, 10);
if (!addressList.isEmpty()) {
for (Address address : addressList) {
String result = address.getAdminArea() != null ? address.getAdminArea() : "?";
result += " | ";
result += address.getSubAdminArea() != null ? address.getSubAdminArea() : "?";
result += " | ";
result += address.getLocality() != null ? address.getLocality() : "?";
result += " | ";
result += address.getSubLocality() != null ? address.getSubLocality() : "?";
result += " | ";
result += address.getThoroughfare() != null ? address.getThoroughfare() : "?";
result += " | ";
result += address.getSubThoroughfare() != null ? address.getSubThoroughfare() : "?";
Log.i(TAG, result);
}
}
} catch (IOException e) {
Log.e(TAG, "Failed Geocoding.");
}
代码示例来源:origin: stackoverflow.com
String addressName = first_address.getThoroughfare();
String streetNumber = first_address
.getSubThoroughfare();
代码示例来源:origin: grzegorznittner/chanu
private void updateLocation(Address address) {
if (address != null) {
Context context = mContext.getAndroidContext();
String parts[] = {
address.getAdminArea(),
address.getSubAdminArea(),
address.getLocality(),
address.getSubLocality(),
address.getThoroughfare(),
address.getSubThoroughfare(),
address.getPremises(),
address.getPostalCode(),
address.getCountryName()
};
String addressText = "";
for (int i = 0; i < parts.length; i++) {
if (parts[i] == null || parts[i].isEmpty()) continue;
if (!addressText.isEmpty()) {
addressText += ", ";
}
addressText += parts[i];
}
String text = String.format("%s : %s", DetailsHelper.getDetailsName(
context, MediaDetails.INDEX_LOCATION), addressText);
mListener.onAddressAvailable(text);
}
}
代码示例来源:origin: grzegorznittner/chanu
closestCommonLocation = valueIfEqual(addr1.getThoroughfare(), addr2.getThoroughfare());
if (closestCommonLocation != null && !("null".equals(closestCommonLocation))) {
return closestCommonLocation;
代码示例来源:origin: grzegorznittner/chanu
writeUTF(dos, locale.getVariant());
writeUTF(dos, address.getThoroughfare());
int numAddressLines = address.getMaxAddressLineIndex();
dos.writeInt(numAddressLines);
代码示例来源:origin: CUTR-at-USF/OpenTripPlanner-for-Android
public CustomAddress(Address address) {
super(address.getLocale());
for (int i = 0; i <= address.getMaxAddressLineIndex(); i++){
super.setAddressLine(i, address.getAddressLine(i));
}
super.setFeatureName(address.getFeatureName());
super.setAdminArea(address.getAdminArea());
super.setSubAdminArea(address.getSubAdminArea());
super.setLocality(address.getLocality());
super.setSubLocality(address.getSubLocality());
super.setThoroughfare(address.getThoroughfare());
super.setSubThoroughfare(address.getSubThoroughfare());
super.setPostalCode(address.getPostalCode());
super.setCountryCode(address.getCountryCode());
super.setCountryName(address.getCountryName());
super.setLatitude(address.getLatitude());
super.setLongitude(address.getLongitude());
super.setPhone(address.getPhone());
super.setUrl(address.getUrl());
super.setExtras(address.getExtras());
}
内容来源于网络,如有侵权,请联系作者删除!