Example usage for java.sql Date getDay

List of usage examples for java.sql Date getDay

Introduction

In this page you can find the example usage for java.sql Date getDay.

Prototype

@Deprecated
public int getDay() 

Source Link

Document

Returns the day of the week represented by this date.

Usage

From source file:org.arasthel.almeribus.Principal.java

@Override
public void onPostCreate(Bundle savedInstanceState) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
    long ultimaActualizacion = sp.getLong("ultima_actualizacion", 0);
    Date fechaUltima = new Date(ultimaActualizacion);
    long nuevoTiempo = System.currentTimeMillis();
    Date nuevaFecha = new Date(nuevoTiempo);

    necesitaActualizacion = false;/*from w w  w.  ja va2s . c  o m*/

    if (nuevaFecha.getDay() != fechaUltima.getDay() || nuevaFecha.getMonth() != fechaUltima.getMonth()
            || nuevaFecha.getYear() != fechaUltima.getYear()) {
        necesitaActualizacion = true;
    }

    // We load the bus stop info from Surbus server
    cargarParadas();
    if (savedInstanceState == null && !necesitaActualizacion && !loaded) {
        savedInstanceState = new Bundle();
        savedInstanceState.putBoolean("SlidingActivityHelper.open", true);
    }
    super.onPostCreate(savedInstanceState);
}