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

  • Home
  • SEARCH
  • 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 8528829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:53:25+00:00 2026-06-11T08:53:25+00:00

I would like to create a Flash class to display a white flash screen

  • 0

I would like to create a “Flash” class to display a white flash screen (200ms) as easily as a toast, like this:

Flash.create(context).show();
  • This layer should appear instantly then gradually disappear (alpha transition)
  • It must not catch events
  • It must adapt to the screen rotation
  • It can be created from any activity

I looked for a solution via WindowManager but I am having some difficulties.
What solution do you recommend?

  • 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-11T08:53:26+00:00Added an answer on June 11, 2026 at 8:53 am

    After searching for many hours, it seems impossible to delegate events from one window to another. So the final functional solution I’ve found is to extend an activity so that it achieves this flash effect. For those who are interested in it, here’s my subclass:

    public class FlmActivity extends Activity {
    
    
        private final static int DURATION_FADEIN = 50;
        private final static int DURATION_FADEOUT = 200;
        private final static int DURATION_INTERVAL = 200;
        private View view;
        private AnimationSet anim;
        private int count;
    
    
        public FlmActivity() {
            super();
        }
    
    
        @Override protected void onPostCreate(Bundle state) {
            super.onPostCreate(state);
            view = new View(this) {{
                setBackgroundColor(0xffffffff);
                setVisibility(View.INVISIBLE);
            }};
            anim = new AnimationSet(false) {{
                addAnimation(new AlphaAnimation(0, 1) {{
                    setDuration(DURATION_FADEIN);
                }});
                addAnimation(new AlphaAnimation(1, 0) {{
                    setStartOffset(DURATION_FADEIN);
                    setDuration(DURATION_FADEOUT);
                }});
                addAnimation(new Animation() {{
                    setStartOffset(DURATION_FADEIN + DURATION_FADEOUT);
                    setDuration(DURATION_INTERVAL);
                    setAnimationListener(new AnimationListener() {
                        @Override public void onAnimationStart(Animation anim) {}
                        @Override public void onAnimationRepeat(Animation anim) {}
                        @Override public void onAnimationEnd(Animation anim) {
                            flash(count - 1);
                        }
                    });
                }});
            }};
            addContentView(view, getWindow().getAttributes());
        }
    
    
        @Override protected void onDestroy() {
            ((ViewGroup) view.getParent()).removeView(view);
            super.onDestroy();
        }
    
    
        public final void flash(int count) {
            if((this.count = count) > 0) {
                view.startAnimation(anim);
            }
        }
    
    
    }
    

    Code to call flash effect in an extended activity:

    flash(10);
    

    With this implementation, the events pass through the layer

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

Sidebar

Related Questions

I would like to create a flash presentation for a web page. It would
I would like to create this shape using just css. I am pretty sure
I would like to create a class that runs something (a runnable) at regular
Hi i made a custom class where i would like to create x instances
I created a document class for an empty stage and would like to create
i would like create a array of structure which have a dynamic array :
I would like to create a c++ type that mimic the build-in type exactly.
I would like to create a json object to send as a post array,
I would like to create set of strings and below is the only limitation.
I would like to create a virtual host in apache2, but I want it

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.