I am still trying to figure out frame animation, but I need to use IDs. I don't get it... I get the wierdest errors...
<?xml version="1.0" encoding="UTF-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false" android:id="@+id/carrotsmileanim">
<item android:drawable="@drawable/carrotsmile" android:duration="2000" />
<item android:drawable="@drawable/carrotblink" android:duration="2000" />
<android:id="@+id/carrotsmileanim></android:id>
</animation-list>
In the ID section the error is: "
android:id" must be followed by either attribute specifications, ">" or "/>"
My Java code is this:
package com.example.carrottest2;
import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.widget.ImageView;
import android.R;
public class Carrottest2 extends Activity {
/** Called when the activity is first created. */
AnimationDrawable mainanimation;
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
ImageView carrotsmile = (ImageView) findViewById(R.id.carrotblink);
rocketImage.setBackgroundResource(R.drawable.rocket_thrust);
c = (AnimationDrawable) rocketImage.getBackground();
carrotsmileanim.start();
The tutorial frame animation android IDs are still there, I never changed them, but it does not recognize carrotblink, rocketImage, rocketthrust, c, carrotsmileanim, and says "cannot be resolved or is not a field." error.
Can someone help me with this? Which is supposed to go where?
Is main.xml involved in this? I know there is supposed to be an imageview somewhere, but where?