Java – the activity to schedule or redirect to another activity
I want to create one using Android intent. action. The scheduler activity defined by main does nothing except call some custom methods according to some standards and finally call startactivity (intent) This activity does not need to be displayed / presented to the user
What best practices should I follow? Of course, I want to produce the least rendering time (no display), but I need to use context to determine which activity to redirect to other operations
So far, I can think of:
> android:finishOnTaskLaunch = "true" > android:stateNotNeeded = "true" > finish () after calling startActivity (Intent) in the scheduler activity.
Solution
You should consider putting the finish () function in the onpause (...) method When other activities enter the foreground, the system will normally call the onpause (...) of the scheduler activity. If you call finish () here, you can make sure that the scheduler activity will be completed in the foreground when another call is made