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 5971097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:28:09+00:00 2026-05-22T20:28:09+00:00

Currently I am in process of developing my android application. My requirement is something

  • 0

Currently I am in process of developing my android application. My requirement is something like this.

I need to run a timer of 5mins and when timeout occurs I need to check certain things and take certain action. This need to be keep on running if the user starts the application.

In my knowledge I want to proceed like this

Create a service and start a timer in that service and do whatever needed when the timer expires. I will put one activity to interact with the service like start or stop.

I need suggestion for my approach and its pros and cons for this approach. To just run a timer do I need a service? If I run the repeated timer in a activity itself and if I press the back-button the activity will go background and will the timer also stop if I have started the timer in that activity?

I am sorry If I am not clear in my question. I have gone through the android application fundamentals and then thinking to ask this question. Please give me some idea.

  • 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-05-22T20:28:09+00:00Added an answer on May 22, 2026 at 8:28 pm

    There’s no need for a service. You can use a Timer and schedule a TimerTask. If the task needs to touch the UI, then you should create a Handler to which you can post a Runnable.

    P.S. You asked about what happens if your activity goes to the background. The Timer will keep running unless you cancel either the task or the timer itself in onPause or one of the other lifecycle methods. Whichever one you do it in, you should start the timer task in the matching start-up lifecycle method. If you are not going to cancel the Timer itself, you should create it as a daemon thread.

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

Sidebar

Related Questions

I'm currently in the process of developing a digg-like Ruby on Rails application for
I'm currently in the process of developing a GWT 1.7.1 application that deals with
I'm currently developing an application which needs a lot of system and process information,
I am currently in the process of developing a canvas application that will make
Greetings, Currently I am in process of developing an application for booking (etc. rooms).
We're currently in the process of developing a web-based application which will require the
I am currently in the planning process of developing an application that I would
Im currently developing an application for android, the first screen of the application is
Currently i am in a process of developing a application which can work in
I am developing web application using Yii framework. currently i am in the process

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.