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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:39:55+00:00 2026-06-09T06:39:55+00:00

For my app, I want a strobe light with multi colors to play, how

  • 0

For my app, I want a strobe light with multi colors to play, how do I do this?

  • 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-09T06:39:56+00:00Added an answer on June 9, 2026 at 6:39 am

    If you want your screen to flash with different colors, that is just a matter of making a timer and having the main view change background colors every so often.

    javax.swing.Timer can be used to change the screen every so often:

    Timer colorChanger = new Timer(500 /*milis between each color change*/, new TimeListener(this) );
    colorChanger.start();
    

    Where TimeListener will be an ActionListener that changes the background color of a specified activity. TimerListener could look like this:

    public class TimerListener implements ActionListener {
        public TimerListener(Activity activity) {
            this.backgroundToChange = activity;
        }
        private Activity backgroundToChange = null; // the activity who's background we will change
        private int numFrames = 0; //the number of frames that have passed
        public void actionPerformed(ActionEvent evt) { //happens when the timer will go off
            numFrames++;
            switch ( numFrames % 2 ) { // every other time it will make the background red or green
                case 0: backgroundToChange.getContentView().setBackgroundColor(Color.RED);
                case 1: backgroundToChange.getContentView().setBackgroundColor(Color.GREEN);
            }
        }
    }
    

    You’re gonna need to import javax.swing.Timer and ActionListener and ActionEvent are in java.awt.event.

    If you’re using android however, you might want to consider using another class that is designed for android other than Timer. Timer is designed for swing and might not work well if you are using it on android. Any other timer like class will work similar to Timer though.

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

Sidebar

Related Questions

This is my code. I want to recognize the multi-stroke gesture in my app
In this app I want that as I click on button the data from
I want do an app,i want it look the same as this one: I
in my app I want to have a light table to sort photos. Basically
in my android app I want to achieve this kind of effect Thinking about
In this app I want a button press to open a different Java file
For my app I want to have a design like this example I made
For example, the users of our app want to search products by entering a
In my app,I want to display some information in the middle of the screen
In my WebView app I want to have a custom onReceivedError screen. Instead I

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.