Example usage for android.location Location set

List of usage examples for android.location Location set

Introduction

In this page you can find the example usage for android.location Location set.

Prototype

public void set(Location l) 

Source Link

Document

Sets the contents of the location to the values from the given location.

Usage

From source file:net.naonedbus.fragment.impl.ItineraireFragment.java

private void reverse() {
    final CharSequence fromText = mFromAddressTextView.getText();
    final CharSequence toText = mToAddressTextView.getText();
    final Location temp = new Location(LocationManager.GPS_PROVIDER);

    mToAddressTextView.setText(fromText);
    mFromAddressTextView.setText(toText);

    temp.set(mFromLocation);
    mFromLocation.set(mToLocation);/*  w  w w.  java2  s . c o m*/
    mToLocation.set(temp);

    int t = mIconToResId;
    mIconToResId = mIconFromResId;
    mIconFromResId = t;

    t = mIconFromColor;
    mIconFromColor = mIconToColor;
    mIconToColor = t;

    boolean tempB = mFromCurrentLocation;
    mFromCurrentLocation = mToCurrentLocation;
    mToCurrentLocation = tempB;

    notifyIconsChanged();
    onFormValueChange();

    final Animation animation = AnimationUtils.loadAnimation(getActivity(), R.anim.rotation_full);
    mReverseButton.startAnimation(animation);
}