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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:42:07+00:00 2026-06-16T05:42:07+00:00

I have 4 int for time int delay; int period; int delay1; int period1;

  • 0

I have 4 int for time

int delay;
int period;
int delay1;
int period1;

they are taking control of these methods:

cameraOn();
    Timer timer = new Timer();
    timer.scheduleAtFixedRate(new TimerTask() {

        @Override
        public void run() {
            // TODO Auto-generated method stub
            cameraOff();
        }
    },delay1,period1);



    Timer timer2 = new Timer();
    timer2.scheduleAtFixedRate(new TimerTask() {

        @Override
        public void run() {
            // TODO Auto-generated method stub
            cameraOn();
        }
    },delay,period);

        }

These methods are doing the flash camera blink all the time, and what I want is with two buttons I have, change the speed of the blink, now they’re like this:

case R.id.btslow:
        delay = 2400;
        period = 2400;
        delay1 = 1200;
        period1 = 2400;
        break;

    case R.id.btfast:
        delay = 600;
        period = 600;
        delay1 = 300;
        period1 = 600;
        break;

but they dont change the speed of the blink, how can I do it? Because if give them some valor from the begining later they don’t change when I press the buttons. Thanks!!

  • 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-16T05:42:09+00:00Added an answer on June 16, 2026 at 5:42 am

    Changing the variables won’t change the interval and delay of the current scheduled tasks, try this: https://stackoverflow.com/a/3871723/1333516

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

Sidebar

Related Questions

I have a const int that is computed at compile time in my Managed
Here's an example I have. public int getDelta() { long time = getTime(); int
I have the following code: int sec = 62; string str = string.Format(Time: {0:xxx},
I have a struct: struct sdata { int x; int y; time_t time; };
I have the following code : public object[] Dispatch(string arg) { int time; int
I have declared the following struct: typedef struct _RECOGNITIONRESULT { int begin_time_ms, end_time_ms; char*
Let's say I have int a() { /* Tons of code ....*/ return someInt;
I have an int property in my viewmodel that returns a custom class property.
I have an int and float array of length 220 million (fixed). Now, I
i have two int array of images , i have implemented it in grid

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.