• 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
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.
 
Nvm this part. I managed to fix the problem by importing the views that causes the errors on the above codes. Now another pressing issue to look into, can anyone tell me as to why this coding is causing Android emulator to be closed when run, at least on the QuizMenuActivity part. Here's the link to it.
 
Back
Top Bottom