• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Random Noob Question 2

dothackjhe

Newbie
Jun 25, 2012
18
0
Given this code:

public class QuizSplashActivity extends QuizActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);

TextView logo1 = (TextView) findViewById (R.id.TextViewTopTitle);
Animation fade1 = AnimationUtils.loadAnimation (this, R.anim.fade_in);
logo1.startAnimation (fade1);

TextView logo2 = (TextView) findViewById (R.id.TextViewBottomTitle);
Animation fade2 = AnimationUtils.loadAnimation (this, R.anim.fade_in2);
logo2.startAnimation (fade2);

Animation spinin = AnimationUtils.loadAnimation(this, R.anim.custom_anim);
LayoutAnimationController controller = new LayoutAnimationController(spinin);
TableLayout table = (TableLayout) findViewById(R.id.TableLayout01);

for (int i = 0; i < table.getChildCount(); i++)
{
TableRow row = (TableRow) table.getChildAt(i);
row.setLayoutAnimation(controller);
}
}
}

Am I applying three different animations to three different views in Android? Or should I make a separate method per each animation code? I'm getting errors on object types TextView, ImageView, LayoutAnimationController, TableLayout, and TableRow as seen by red underscores in those words as well as the corresponding "x" images on their leftmost side.

Btw, I've made external animation resources under res/anim folder namely fade_in.xml, fade_in2.xml, and custom_anim.xml as is called in the few lines of codes in the whole coding as was posted.
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones