from Location String to create Location - Android Map

Android examples for Map:Location String

Description

from Location String to create Location

Demo Code


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

public class Main {
    public static Location fromLocationString(String locationString) {
        Location location = new Location((String) null);
        String[] parts = locationString.split(",");
        location.setLatitude(Location.convert(parts[0]));
        location.setLongitude(Location.convert(parts[1]));
        return location;
    }// ww w  . j a va  2  s  . co  m
}

Related Tutorials