Java Code Examples for com.blankj.utilcode.util.Utils#getApp()

The following examples show how to use com.blankj.utilcode.util.Utils#getApp() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocationUtils.java    From AndroidUtilCode with Apache License 2.0 5 votes vote down vote up
/**
 * 根据经纬度获取地理位置
 *
 * @param latitude  纬度
 * @param longitude 经度
 * @return {@link Address}
 */
public static Address getAddress(double latitude, double longitude) {
    Geocoder geocoder = new Geocoder(Utils.getApp(), Locale.getDefault());
    try {
        List<Address> addresses = geocoder.getFromLocation(latitude, longitude, 1);
        if (addresses.size() > 0) return addresses.get(0);
    } catch (IOException e) {
        e.printStackTrace();
    }
    return null;
}
 
Example 2
Source File: DebugUtils.java    From AndroidUtilCode with Apache License 2.0 4 votes vote down vote up
public static Application getApp() {
    return Utils.getApp();
}