마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

animation-list 오류 ... 5장넘어가면오류뜨네요

0 추천
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:oneshot="false" >

    <!--<item android:drawable="@drawable/p1" android:duration="400" />
    <item android:drawable="@drawable/p2" android:duration="400" />
    <item android:drawable="@drawable/p3" android:duration="400" />
    <item android:drawable="@drawable/p4" android:duration="400" />
    <item android:drawable="@drawable/p5" android:duration="400" />
    <item android:drawable="@drawable/p6" android:duration="400" />
    <item android:drawable="@drawable/p7" android:duration="400" />
    <item android:drawable="@drawable/p8" android:duration="400" />-->
    <item android:drawable="@drawable/p9" android:duration="400" />
    <item android:drawable="@drawable/p10" android:duration="400" />
    <item android:drawable="@drawable/p11a" android:duration="500" />
    <item android:drawable="@drawable/p11b" android:duration="500" />
    <item android:drawable="@drawable/p11c" android:duration="500" />

</animation-list>
public class EntActivity extends AppCompatActivity {

    private AnimationDrawable frameAnimation;
    private ImageView view;
    @Override
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ent);

        // 컨트롤 ImageView 객체를 가져온다
        view = (ImageView) findViewById(R.id.img);
        // animation_list.xml 를 ImageView 백그라운드에 셋팅한다
        view.setBackgroundResource(R.drawable.animation_list);
        // 이미지를 동작시키기위해  AnimationDrawable 객체를 가져온다.
        frameAnimation = (AnimationDrawable) view.getBackground();
    }

    // 어플에 포커스가 가면 동작한다
    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        if (hasFocus) {
            // 어플에 포커스가 갈때 시작된다
            frameAnimation.start();
        } else {
            // 어플에 포커스를 떠나면 종료한다
            frameAnimation.stop();
        }
    }
pbss (460 포인트) 님이 2019년 5월 24일 질문
혹시나하고 그림파일에 문제가 있나해서 다른그림이 우선 뜨게 바꾸어 돌려보아도
그냥 5장넘어가면 오류뜨는걸로 판명났습니다...

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...