Create location and set property - Android java.util

Android examples for java.util:Properties

Description

Create location and set property

Demo Code


//package com.java2s;
import android.location.Location;

public class Main {
    public static Location location(String provider, double latitude,
            double longitude, long time, float accuracy) {
        Location location = new Location(provider);
        location.setLatitude(latitude);/*  w w  w. j a v  a 2 s.  c o m*/
        location.setLongitude(longitude);
        location.setTime(time);
        location.setAccuracy(accuracy);
        return location;
    }
}

Related Tutorials