Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8408199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:34:07+00:00 2026-06-09T23:34:07+00:00

I have an app with BG agent implementation. If the BG agent identifies any

  • 0

I have an app with BG agent implementation. If the BG agent identifies any up-gradation availability then it will notify the same to the user through a toast notification. I have one doubt regarding this. The scenario is something like this, if the app is exited and is running in the BG then the toast notification(TN) is displayed, everything is smooth and fine. But, if the app is running in the FG and also in the BG and BG has something to notify to the user, then TN is not displayed, though everything is logged in the log file nothing shows up on the UI of the device. Is this normal? or should something be done? Also, Is there a way to detect if my application is running in the FG or not? If so i don’t want to start the BG task , Can this be implemented?

All answers and suggestions appreciated.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T23:34:08+00:00Added an answer on June 9, 2026 at 11:34 pm

    You may use Thread.CurrentThread.IsBackground to check if its in the background or foreground and do work accordingly. Also you may make use of Thread.CurrentThread.IsAlive according to your requirements. You may find useful information here: http://msdn.microsoft.com/en-us/library/h158zycw

    If the app is in background use Toast Notifications else use Raw Notifictions. You can learn about Raw Notifications from here: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202977(v=vs.92).aspx

    So summarizing it, you may use toast notification when app is the BG and raw notifications when app is in the FG

    I haven’t tried this, but i guess it should work if I am not wrong. Also there is a similar question on this here at How to detect if the main app is running from a background agent

    If the threading option works then it great, else you may also try using the application state property mentioned on http://www.windowsphonegeek.com/articles/WP7-Application-Lifecycle-and-Tombstoning to check and track the state of your app, i.e. if its BG or FG.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to send User-agent to the server from my app. Mozilla/4.0 (compatible; MSIE
lets say i have app id, app secret id and user uid now i
I have created Cocoa app which is type of launch agent. To distribute this
I have a background agent and a foreground app on Windows Phone Mango. (These
I am running my app locally in safari and testing a mobile user agent
I have Facebook app in my site. When we integrate Facebook, it will leads
I write an Agent Cocoa app where I have TextField in status icon's menu,
I have an mvc2 app which is serving content through iframes. The iframed page
Background: I have a winForm app that registers a user in the database based
I have a Java module that receives the User-Agent string from an end user's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.