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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:26:50+00:00 2026-06-15T14:26:50+00:00

I have an ImageView . I want to: 1 – shrink the view 2

  • 0

I have an ImageView. I want to:
1 – shrink the view
2 – change the image resource
3 – scale back the view

I tried to this in the following section of code, but this is not working. It behaves like the 3rd row doesn’t exist. Can someone tell me what I’m doing wrong?

Animation anim = AnimationUtils.loadAnimation(this, R.anim.scale);
Animation animo = AnimationUtils.loadAnimation(this, R.anim.scale_out);
i.startAnimation(anim);
i.setImageResource(R.drawable.logoc);
i.startAnimation(animo);

scale.xml:

 <?xml version="1.0" encoding="utf-8"?>
 <scale xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXScale="1.0" 
android:toXScale="0.125"
android:fromYScale="1.0" 
android:toYScale="0.125" 
android:pivotX="50%"
android:pivotY="50%" 
android:startOffset="0" 
android:duration="400"
android:fillBefore="true" />

scale_out.xml:

<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXScale="1.0" 
android:toXScale="4.0"
android:fromYScale="1" 
android:toYScale="4.0" 
android:startOffset="400" 
android:pivotX="50%"
android:pivotY="50%"
android:duration="800"
 />
  • 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-15T14:26:51+00:00Added an answer on June 15, 2026 at 2:26 pm

    I think you should try doing this way:

    i.startAnimation(anim);
    if (anim.hasEnded())
    {
        i.setImageResource(R.drawable.logoc);
        i.startAnimation(animo);
    }
    

    Edit:

    Ok, I was wrong: This works:

    public class MyAnimationListener implements AnimationListener {
    
            @Override
            public void onAnimationEnd(Animation animation) {
                // TODO Auto-generated method stub
    
                i.setImageResource(R.drawable.bg);
                i.startAnimation(animo);
    
            }
    
            @Override
            public void onAnimationRepeat(Animation animation) {
                // TODO Auto-generated method stub
    
            }
    
            @Override
            public void onAnimationStart(Animation animation) {
                // TODO Auto-generated method stub
    
            }
    
        }
    

    MyAnimationListener mListener = new MyAnimationListener();
            anim.setAnimationListener(mListener);
            i.startAnimation(anim);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an imageview, which uses matrix to scale/drag an image. Now I want
I have a ImageView and draw some things on that view. Now I want
I want to show an image view for three like on/off,if any one have
i have a imageView in table cell now i want to chnage image on
I have an Imageview in my android application. I want to move and scale
I have an ImageView with an image loaded, I want that when the user
I have a imageview that I want to change the color based on a
I have an imageview in which I want an image to be set. My
I have an ImageView with a png and I want to do this: when
I have an ImageView, and on a click I want to replace its image

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.