locked
How to switch to foreground --- 怎么将程序由后台转为前台

    Question

  • 在Metro开发中,有没有办法实现类似Android中的效果:

    在一个后台线程中启动程序的主界面,比如:在service中启动当前的Activity,把activity切换到前台。而不用用户点击。

    类似的效果,有没有办法在metro中实现啊,我尝试过在Background Task中启动,但是失败了。

    Translate to English:

    In metro App , how to switch a metro app to foreground from background without user's click.

    Such as Android , I can start the activity in the service without user's click .

    I have try this in Background Task in metro ,but fail.

    -Thanks.


    • Edited by famingyuan Saturday, August 4, 2012 1:34 AM
    Friday, August 3, 2012 2:21 AM

Answers

  • When the user touches or clicks on the notification the app will be activated and can choose snooze, close, etc.

    I would probably have it default to snooze and let the user choose to end the alarm explicitly.

    --Rob

    • Marked as answer by famingyuan Saturday, August 4, 2012 6:48 AM
    Saturday, August 4, 2012 5:28 AM
    Moderator

All replies

  • Hi,

    this shouldn't be possible, because this action is handled by the OS and can only be directly triggered by the OS or the user.


    Best Regards. When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. This helps us build a healthy and positive community.

    Friday, August 3, 2012 7:28 AM
  • Hi, Horizon,

    So , if I want to create a metro app for alarm. I need notificate user at the appointment time. But the method I use is not very suitable for the alarm. You know when the alarm clock bell , user always try to close it or snooze it . But the metro app can not provide a method for this.

    metro app can not provide a interface for user to choose whether close or snooze the alarm clock when the metro app do not stay at foreground.The notification just stay several seconds and dismiss ,and the notification can not provide a choice for user because when you click the notification ,it just start the app even if you can pass some parameters to the app.

    Sorry, maybe I do not explain clearly.

    - thanks.

    Friday, August 3, 2012 8:14 AM
  • HI

    I think long duration toasts notification is a good choice.

    Please check this SDK sample scenario 6

    http://code.msdn.microsoft.com/windowsapps/Toast-notifications-sample-52eeba29

    This toasts notification will stay a long time.

    Friday, August 3, 2012 9:07 AM
  • hi, Dino.

    Long duration toasts notification is a good choice for notification user ,

    but It can not provide a choice for user that user can choose whether close or snooze the alarm clock.

    Maybe Metro app can not do a job for alarm clock.

    -thanks.

    Saturday, August 4, 2012 1:32 AM
  • When the user touches or clicks on the notification the app will be activated and can choose snooze, close, etc.

    I would probably have it default to snooze and let the user choose to end the alarm explicitly.

    --Rob

    • Marked as answer by famingyuan Saturday, August 4, 2012 6:48 AM
    Saturday, August 4, 2012 5:28 AM
    Moderator
  • Hi, Rob.

    thanks for your reply and another reply.

    Maybe I should accept your suggestion . When user clicks the notification , the app will be activated , then I show a interface for choosing snoozes or close.

    thank you , Rob .

    Saturday, August 4, 2012 6:57 AM