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

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

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

Address.<init>介绍

暂无

代码示例

代码示例来源:origin: robolectric/robolectric

  1. @Test
  2. public void getFromLocationReturnsTheOverwrittenListLimitingByMaxResults() throws IOException {
  3. ShadowGeocoder shadowGeocoder = shadowOf(geocoder);
  4. List<Address> list = Arrays.asList(new Address(Locale.getDefault()), new Address(Locale.CANADA));
  5. shadowGeocoder.setFromLocation(list);
  6. List<Address> result = geocoder.getFromLocation(90.0, 90.0, 1);
  7. assertThat(result).hasSize(1);
  8. result = geocoder.getFromLocation(90.0, 90.0, 2);
  9. assertThat(result).hasSize(2);
  10. result = geocoder.getFromLocation(90.0, 90.0, 3);
  11. assertThat(result).hasSize(2);
  12. }

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

  1. private Address makeAddress() {
  2. Address address = new Address(Locale.getDefault());
  3. shadowOf(address).setSimulatedHasLatLong(hasLatitude, hasLongitude);
  4. return address;
  5. }

代码示例来源:origin: sytolk/TaxiAndroidOpen

  1. JSONObject result = results.getJSONObject(i);
  2. Address addr = new Address(Locale.getDefault());

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

  1. private Address makeAddress() {
  2. Address address = new Address(Locale.getDefault());
  3. address.setLatitude(simulatedLatitude);
  4. address.setLongitude(simulatedLongitude);
  5. ReflectionHelpers.setField(address, "mHasLatitude", hasLatitude);
  6. ReflectionHelpers.setField(address, "mHasLongitude", hasLongitude);
  7. return address;
  8. }

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

  1. Address gAddress = new Address(mLocale);
  2. String displayName = "";
  3. if (!jResult.has("point") || !jResult.has("name"))

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

  1. return null;
  2. Address address = new Address(locale);
  3. address.setLatitude(result.getDouble(WIRE_LATITUDE));
  4. address.setLongitude(result.getDouble(WIRE_LONGITUDE));

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

  1. Address gAddress = new Address(mLocale);
  2. if (!jResult.has("lat") || !jResult.has("lon") || !jResult.has("address"))
  3. return null;

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

  1. return lookupAddress(latitude, longitude, false);
  2. address = new Address(locale);

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

  1. public static android.location.Address toAddress(PersistableBundle persistableBundle) {
  2. if (persistableBundle == null) {
  3. return null;
  4. }
  5. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
  6. String language = persistableBundle.getString("language");
  7. String country = persistableBundle.getString("country");
  8. String variant = persistableBundle.getString("variant");
  9. Locale addressLocale = new Locale(language, country, variant);
  10. android.location.Address address = new android.location.Address(addressLocale);
  11. address.setLocality(persistableBundle.getString("locality"));
  12. address.setSubLocality(persistableBundle.getString("subLocality"));
  13. address.setAdminArea(persistableBundle.getString("adminArea"));
  14. address.setSubAdminArea(persistableBundle.getString("subAdminArea"));
  15. address.setCountryName(persistableBundle.getString("countryName"));
  16. return address;
  17. } else {
  18. return null;
  19. }
  20. }

相关文章