Ver Mensaje Individual
  #6  
Viejo 07/02/12, 21:37:17
Array

[xs_avatar]
the_gentleman the_gentleman no está en línea
Usuario novato en la web
 
Fecha de registro: ene 2012
Mensajes: 9
Modelo de smartphone: Galaxy S i9000
Tu operador: Orange
He hecho esto en el onCreate, pero no me recarga la actividad

Intent intent = new Intent(this, miPantalla.class);
PendingIntent sender = PendingIntent.getService(this, 0, intent, 0);

// We want the alarm to go off 60 seconds from now.
long firstTime = SystemClock.elapsedRealtime();
int REPEATING_ALARM_INTERVAL_IN_MINUTES = 0;
firstTime += REPEATING_ALARM_INTERVAL_IN_MINUTES * 60 * 1000;

// Schedule the alarm!
AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKE UP, firstTime,
REPEATING_ALARM_INTERVAL_IN_MINUTES * 60 * 1000, sender);


Edito: SOLUCIONADO! Con el getIntent de kriogeN me he montado algunas paranoias con unos tabs que muestro y lo he recargado de nuevo con un codigo que he encontrado por ahi, en concreto es:

Código:
public static int MILISEGUNDOS_ESPERA = 5000;
public void onClick_AccionTrasSegundos(View v) {
    esperarYCerrar(MILISEGUNDOS_ESPERA);
}

/**
 * Espera y recarga la aplicación tras los milisegundos indicados
 * @param milisegundos
 */
public void esperarYCerrar(int milisegundos) {
    Handler handler = new Handler();
    handler.postDelayed(new Runnable() {
        public void run() {
            // acciones que se ejecutan tras los milisegundos
            finalizarApp();
        }
    }, milisegundos);
}

/**
 * Recarga la aplicación
 */
public void finalizarApp() {
    Intent intent = new Intent(this, Container.class);
    startActivity(intent);

}
__________________
Sgs i9000xxjvk 1200mhz
CM7 Nightly 181 2.3.7
Kernel NEO 17 r16

Última edición por the_gentleman Día 07/02/12 a las 22:21:59. Razón: Solucionado el problema
Responder Con Cita