android.location.Address.setAdminArea()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中android.location.Address.setAdminArea()方法的一些代码示例,展示了Address.setAdminArea()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.setAdminArea()方法的具体详情如下:
包路径:android.location.Address
类名称:Address
方法名:setAdminArea

Address.setAdminArea介绍

暂无

代码示例

代码示例来源:origin: MKergall/osmbonuspack

gAddress.setAdminArea(jResult.get("state").getAsString());

代码示例来源:origin: thuryn/your-local-weather

address.setPostalCode(a.optString(WIRE_POSTALCODE));
address.setSubAdminArea(a.optString(WIRE_SUBADMINAREA));
address.setAdminArea(a.optString(WIRE_ADMINAREA));
address.setCountryName(a.optString(WIRE_COUNTRYNAME));
address.setCountryCode(a.optString(WIRE_COUNTRYCODE));

代码示例来源:origin: MKergall/osmbonuspack

gAddress.setAdminArea(jAddress.get("state").getAsString());

代码示例来源:origin: org.robolectric/shadows-maps

@Implementation
public List<Address> getFromLocation(double latitude, double longitude, int maxResults) throws IOException {
 wasCalled = true;
 this.lastLatitude = latitude;
 this.lastLongitude = longitude;
 if (shouldSimulateGeocodeException) {
  throw new IOException("Simulated geocode exception");
 }
 Address address = makeAddress();
 address.setAddressLine(0, addressLine1);
 address.setLocality(city);
 address.setAdminArea(state);
 address.setPostalCode(zip);
 address.setCountryCode(countryCode);
 return Arrays.asList(address);
}

代码示例来源:origin: com.github.japgolly.android.test/robolectric

@Implementation
public List<Address> getFromLocation(double latitude, double longitude, int maxResults) throws IOException {
  wasCalled = true;
  this.lastLatitude = latitude;
  this.lastLongitude = longitude;
  if (shouldSimulateGeocodeException) {
    throw new IOException("Simulated geocode exception");
  }
  Address address = makeAddress();
  address.setAddressLine(0, addressLine1);
  address.setLocality(city);
  address.setAdminArea(state);
  address.setPostalCode(zip);
  address.setCountryCode(countryCode);
  return oneElementList(address);
}

代码示例来源:origin: grzegorznittner/chanu

address.setAdminArea(readUTF(dis));
address.setSubAdminArea(readUTF(dis));

代码示例来源:origin: thuryn/your-local-weather

public static android.location.Address toAddress(PersistableBundle persistableBundle) {
  if (persistableBundle == null) {
    return null;
  }
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    String language = persistableBundle.getString("language");
    String country = persistableBundle.getString("country");
    String variant = persistableBundle.getString("variant");
    Locale addressLocale = new Locale(language, country, variant);
    android.location.Address address = new android.location.Address(addressLocale);
    address.setLocality(persistableBundle.getString("locality"));
    address.setSubLocality(persistableBundle.getString("subLocality"));
    address.setAdminArea(persistableBundle.getString("adminArea"));
    address.setSubAdminArea(persistableBundle.getString("subAdminArea"));
    address.setCountryName(persistableBundle.getString("countryName"));
    return address;
  } else {
    return null;
  }
}

代码示例来源: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());
}

相关文章