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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:18:15+00:00 2026-06-05T03:18:15+00:00

I have one Relative Layout and i have set it’s background as drawable, which

  • 0

I have one Relative Layout and i have set it’s background as drawable, which is a selector.

There are total tow background to this Relative Layout and one is in state as selected and one is in non selected mode, both the states are handled in the drawable selector xml file.

What i want to implement is when selector switch the background image from selected to not selected or vice-versa i want to display fade in/out animation.

I found out that i need to use android:exitFadeDuration="@android:integer/config_mediumAnimTime for implementing this in xml file but i am using Android API level 8 and it does not have this property.

So do i need to implement this in java code, how should i implement this in java?
Is there any other option to implement it in xml?

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-05T03:18:17+00:00Added an answer on June 5, 2026 at 3:18 am

    Please use the following line it will solve your problem.

    checkBox1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
    
                   @Override
                   public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) {
    
    
                        imageView1.setBackgroundResource(R.drawable.checkbox_normal);
                        Animation hyperspaceJump = AnimationUtils.loadAnimation(Test1Activity.this, R.anim.animation_big_to_small_rotate); 
                        imageView1.startAnimation(hyperspaceJump); 
                        imageView1.setVisibility(View.VISIBLE);
    
    
                   }
                });
    

    instead of animation_big_to_small_rotate use the xml file which you have for animation. and you can change the images as your wish.

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

Sidebar

Related Questions

This is the scenario: I have one image background set on an activity. On
i am making android UI (using Relative Layout)in which, i need to set one
I have one xml file in which I added one relative layout and below
i have one main relative layout in that i have buttons and in middle
I have a relative layout and in that I have 4 imageViews stacked one
I have a layout A composed by a set of 2 texts and one
I have one RelativeLayout in which i have 5 buttons, I hide this RelativeLayout
I have a RelativeLayout with one child as <include another.xml> like this root.xml :
I have one parent div with style position relative and couple divs inside that
I have one Stored Procedure which takes around 2-3 minutes to complete its execution.

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.