Android Question CallSubDelayed

Discussion in 'Android Questions' started by b4auser1, Mar 2, 2015.

  1. b4auser1

    b4auser1 Well-Known Member Licensed User

    I have read in the manual: Tutorial - Using CallSubDelayed to interact between activities and services

    CallSubDelayed makes it much simpler. It allows you to call a sub in a different service or activity. If the target module is not active, then it will be started automatically. When the target module is ready, the sub will be called.

    CallSubDelayed doesn't immediately call the target sub. It sends a message to the message queue. The internal framework manages this message and passes it to the target module when it is ready.

    ----------

    But my experments showed, that CallSubDelayed called from service doesn't force the activity, which is not active, to be started automatically. Is it correct behavior ?
     
  2. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Yes, this is the correct behaviour.

    I'm not sure what kind of selective reading you are doing, the answer to your question is on the same page just a few lines below:

     
  3. Erel

    Erel Administrator Staff Member Licensed User

    This happens (by design) when there isn't any visible activity. This means that your app is in the background at that point. Automatically showing an activity will result in a bad user experience.
     
  4. b4auser1

    b4auser1 Well-Known Member Licensed User

    Thank you guys. I was not attentive :(
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice