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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:13:07+00:00 2026-06-03T01:13:07+00:00

I have a view which need to fade out before I remove it, here

  • 0

I have a view which need to fade out before I remove it, here is the code:

private void startViewFadeOut(final View v, final LinearLayout layout)
{
    AnimationTask fadeTask = new AnimationTask(_handler,
                                               FADE_OUT_DURATION
                                               , FADE_PERIOD)
    {
        @Override
        protected boolean onRun(float progress)
        {
            float fadeAlpha = 1 - progress;
            v.setAlpha(fadeAlpha);

            if (progress >= 1f)
            {
                layout.removeView(v);  -- line A
                return false;
            }
            return true;
        }
    };
    fadeTask.start();
}

The AnimationTask is just a wrapper of Runnable.
The fading out is working well, but at line A this view will blink, it become visible again and then disappear, I’ve tried to use v.setVisibility(View.GONE), it’s not working eighter.

Anybody has any idea about 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-03T01:13:09+00:00Added an answer on June 3, 2026 at 1:13 am

    It’s a bit unclear from your sample, but I suspect this will all work better if you post the runnable to the activity rather than creating a separate task so it will all be in the same thread.

    I’d also definitely use setVisibility(view.gone).

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

Sidebar

Related Questions

I need to have a view which shows first before other views but doesn't
I am using cancan for authorization. I have a shared view which need authorize
I have a simple table view which is editable. All I need the user
In my custom View which I have added to my viewControllers's view, I need
I have Text( http://www.mywebsite.com ) in a view, in which i need to provide
How is this done? I have a view which in certain conditions I need
I have a View on which I need to display a date formatted in
I have a View which is a series of images. I need the output
I have a custom view to which I need to add a couple of
I have a form(table view) which contains textfields and textview as subviews,I need to

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.