actividad para enviar o redirigir a otras actividades

I want to create a dispatcher activity, defined with android.intent.action.MAIN, which will do nothing but call some custom methods and eventually startActivity(Intent), based upon certain criteria. This activity has nothing to display/render to the user.

What best practices should I follow? Of course, I wish to incur the least rendering time (nothing to display), but I will need to use the Context for other actions in determining which Activity to redirect to.

Hasta ahora puedo pensar en:

  1. android:finishOnTaskLaunch="true"
  2. android:stateNotNeeded="true"
  3. Llame al finish() después de llamar startActivity(Intent) in dispatcher activity

preguntado el 27 de agosto de 11 a las 18:08

1 Respuestas

You should consider putting the finish() function in the onPause(...) method. When the other Activity comes in foreground, the onPause(...) of the dispatcher Activity will be called by the system normally and if you call the finish() here, you can be sure that the dispatcher Activity will be finished when another comes in foreground.

Respondido el 06 de Septiembre de 12 a las 00:09

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.