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:
- Llame al
finish()después de llamar
startActivity(Intent)in dispatcher activity
preguntado el 27 de agosto de 11 a las 18:08
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.