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

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>