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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:11:42+00:00 2026-06-11T00:11:42+00:00

I have seen in Android mobile. When i click photo gallery, one image is

  • 0

I have seen in Android mobile. When i click photo gallery, one image is opened (Fade in) and after I clicked disappeared (Fade out).

Same, I have done in my app. I have pasted one image in Drawable. And applied Fade in and Fade out conditions. But I have not seen any images than sky blue color background. That is view.

How could I do this programmatically in Android?

In what way can I fix this problem? What mistake have I done here?

My code is:

btn=(Button)findViewById(R.id.Click);
   viewToAnimate=(View)findViewById(R.id.view1);
   btn.setOnClickListener(new View.OnClickListener() {

    @Override
    public void onClick(View v) {


        if(viewToAnimate.getVisibility()==View.VISIBLE)
        {
            boolean toRight = false;
            Context c = null;
            //Animation out=AnimationUtils.makeOutAnimation(this,true);
            Animation out=AnimationUtils.makeOutAnimation(c, toRight);
            viewToAnimate.startAnimation(out);
             viewToAnimate.setVisibility(View.INVISIBLE);

        } else {
          int id = 0;
        Context c = null;
        //  Animation in = AnimationUtils.loadAnimation(this, android.R.anim.fade_in);
           Animation in=AnimationUtils.loadAnimation(c, id);

            viewToAnimate.startAnimation(in);
            viewToAnimate.setVisibility(View.VISIBLE);
        }
    }
} );



} }

Then in Main.xml :

 <Button
    android:id="@+id/Click"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" />

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/fade" />


<View
    android:id="@+id/view1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="#AAA" 
    android:src="@drawable/fade"/>
  • 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-11T00:11:44+00:00Added an answer on June 11, 2026 at 12:11 am

    for fadeIn.xml

     <?xml version="1.0" encoding="UTF-8"?>
           <set xmlns:android="http://schemas.android.com/apk/res/android">
             <alpha android:fromAlpha="0.0" android:toAlpha="1.0" 
              android:interpolator="@android:anim/accelerate_interpolator" 
              android:duration="2000"/>
         </set>
    

    for fadeOut.xml

     <set xmlns:android="http://schemas.android.com/apk/res/android">
             <alpha android:fromAlpha="1.0" android:toAlpha="0.0" 
              android:interpolator="@android:anim/accelerate_interpolator" 
              android:duration="2000"/>
         </set>
    

    try using this animation in your image view..

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

Sidebar

Related Questions

I have seen this question: android how to download an 1mb image file and
i have seen in android 2.2 that on click of the contact a floating
I have seen the following snippet in GoogleAnalytics' Android library code: private class TrackerThread
I have seen in android native Email application that it updates the icon by
I want to implement Facebook Connect in my android application. I have seen a
I have a mobile Flex project which I am deploying to iPhone/iPod and Android.
I have seen android applications once installed on any Android device, I can see
If you have seen the skype android app, then you may have noticed that
I have seen how to draw a shape in Android, but what I want
I have seen lot of threads about loading a PDF in Android Webview. But

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.