"Android" activity toggle effect-How to control when you start your activity through the service

Source: Internet
Author: User

1 Reason: When you search for activity on the Internet, it basically tells you that eitherXMLOr isoverridependingtransition, but if you are the service startup activity what to do, this online does not have an answer, so I think about it, found in fact very simple. 2 Solution:In fact, it is very simple, let us understand the principle, so-called activity switching is nothing more than activity according to theme or others startactivity when the call overridependingtransition Changes the parameters of the activity switch, so it's easy to call overridependingtransition in the OnCreate method of the activity you want to start.
@Overrideprotected void OnCreate (Bundle savedinstancestate) {overridependingtransition (0, 0); Super.oncreate ( Savedinstancestate); Setcontentview (r.layout.history_activity); Initview ();}

Finally, if you want to implement service control, then let the service pass the parameters and then modify theoverridependingtransitionyou can do it. Online are all the same, found the API to think unsanitary environment, in fact, we are more reflective of this API trial occasion.

"Android" activity toggle effect-How to control when you start your activity through the service

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.