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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:18:30+00:00 2026-05-31T05:18:30+00:00

How can I start a chronometer in a service? I ask this because you

  • 0

How can I start a chronometer in a service?

I ask this because you can’t associate an XML file to a service

Chronometer mChronometer = (Chronometer) findViewById(R.id.chronometer);

My goal is to vibrate phone after the prox sensor has been keep covered for at least 5 seconds.

  • 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-31T05:18:30+00:00Added an answer on May 31, 2026 at 5:18 am

    In onNear i would like to start a chronometer and do something if the object is still near the sensor when chronometer reaches 5 seconds.

    Chronometer is a widget. It is part of the user interface. Services do not have a user interface. Services do not use widgets. Services do not use Chronometer.

    Use Timer and TimerTask to get control after five seconds within a service.

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

Sidebar

Related Questions

I can start a phone call using this code var url = NSUrl.FromString(tel:+xxxxx); UIApplication.SharedApplication.OpenUrl(url);
I can start activity from service but I cannot restart it, this flag only
I can start the service correctly if the service's Log on account has a
I implemented some app that can start Play Store. This is some kind of
I know you can start a service on Boot , but how do I
Can you give me a good start for this? Thanks! Edit: The accepted answer
Example code so I can start explaining this problem: <div style=z-index:5>5</div> <div style=z-index:2>2</div> <div
I found this documentation that indicates you can start Delphi with an alternate registry
am startservice com.xxx/.service.XXXService i can start a service through the command above , but
I have this code: public class Chronom extends Activity { Chronometer mChronometer; ProgressBar progre;

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.