Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Simple Android App (retired 2014) Pretty Little Things Animating the Answer

Nick Miller
Nick Miller
4,417 Points

Where am I going wrong?

The problem given:

"Below the TextView line, declare an AlphaAnimation variable named fadeOutAnimation. Use the AlphaAnimation constructor that takes two parameters: the start alpha and end alpha values. Set the start alpha parameter as completely opaque and the end alpha parameter as completely transparent."

My answer:

'''Java

AlphaAnimation fadeOutAnimation = new AlphaAnimation(0, 1);

'''

It's saying I'm wrong, but I can't figure out why.

Nick Miller
Nick Miller
4,417 Points

Nevermind! I had my 1 and 0 switched. Doh!

1 Answer

Just switch the order of the 1 and 0. A 1 means completely opaque and a zero means completely transparent. The first parameter is the starting transparency and the second parameter is the ending transparency.