Android 三星galaxy上的动画不断崩溃

Android 三星galaxy上的动画不断崩溃,android,animation,samsung-mobile,Android,Animation,Samsung Mobile,我有一个问题,我的应用程序不断崩溃的动画我试图做。它在我的Razr版本4.1.2上运行良好,但在galaxy上它崩溃了,出现了NumberFormatException版本2.3.6 有人能告诉我为什么会崩溃吗?我仍在试图弄清楚这是否是sdk版本问题。我还尝试在三星S3上安装我的signed.apk,但它甚至无法安装。它只是给了我一个空白屏幕。这似乎只是三星手机的一个问题 public class RSEanimation extends Activity { @Overrid

我有一个问题,我的应用程序不断崩溃的动画我试图做。它在我的Razr版本4.1.2上运行良好,但在galaxy上它崩溃了,出现了
NumberFormatException
版本2.3.6

有人能告诉我为什么会崩溃吗?我仍在试图弄清楚这是否是sdk版本问题。我还尝试在三星S3上安装我的signed.apk,但它甚至无法安装。它只是给了我一个空白屏幕。这似乎只是三星手机的一个问题

    public class RSEanimation extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);     
        super.setContentView(R.layout.startup);
        final ImageView animationTarget1 = (ImageView) this.findViewById(R.id.rseImage);
        final TextView animationTarget2 = (TextView) this.findViewById(R.id.textView1);
        final TextView animationTarget3 = (TextView) this.findViewById(R.id.textView2);
        final TextView animationTarget4 = (TextView) this.findViewById(R.id.textView3);
        Animation animation = AnimationUtils.loadAnimation(this, R.anim.scale);
        final Animation animation1 = AnimationUtils.loadAnimation(this, R.anim.left_to_right);
        final Animation animation2 = AnimationUtils.loadAnimation(this, R.anim.left_to_right);
        final Animation animation3 = AnimationUtils.loadAnimation(this, R.anim.left_to_right);
        final Animation animation4 = AnimationUtils.loadAnimation(this, R.anim.right_to_left);
        animationTarget1.startAnimation(animation);
        animationTarget4.setVisibility(View.VISIBLE);
        animationTarget4.startAnimation(animation1);        

        animation1.setAnimationListener(new AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {}
            @Override
            public void onAnimationRepeat(Animation animation) {} 
            @Override
            public void onAnimationEnd(Animation animation) {
                animationTarget3.setVisibility(View.VISIBLE);
                animationTarget3.startAnimation(animation2);
            }
        });
        animation2.setAnimationListener(new AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {}
            @Override
            public void onAnimationRepeat(Animation animation) {}
            @Override
            public void onAnimationEnd(Animation animation) {
                animationTarget2.setVisibility(View.VISIBLE);
                animationTarget2.startAnimation(animation3);
            }
        });
        animation3.setAnimationListener(new AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {}

            @Override
            public void onAnimationRepeat(Animation animation) {
            }
            @Override
            public void onAnimationEnd(Animation animation) {
                animationTarget1.startAnimation(animation4);
                animationTarget2.startAnimation(animation4);
                animationTarget3.startAnimation(animation4);
                animationTarget4.startAnimation(animation4);
            }
        });
        animation4.setAnimationListener(new AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {}

            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                animationTarget1.setVisibility(View.INVISIBLE);
                animationTarget2.setVisibility(View.INVISIBLE);
                animationTarget3.setVisibility(View.INVISIBLE);
                animationTarget4.setVisibility(View.INVISIBLE);
                 RSEanimation.this.startActivity(new Intent(RSEanimation.this, RiverConditionsActivity.class));

            }
        });


       }

     @Override
        public void onRestart() {
              super.onRestart();   
                  finish();
     }
    }
日志:

06-22 19:53:41.164: W/ResourceType(5374): Entry identifier 0x12c is larger than entry count 0xac
06-22 19:53:41.187: W/Resources(5374): Converting to float: TypedValue{t=0x6/d=0x20c530 a=-1}
06-22 19:53:41.187: W/dalvikvm(5374): threadid=1: thread exiting with uncaught exception (group=0x40015578)
06-22 19:53:41.195: E/AndroidRuntime(5374): FATAL EXCEPTION: main
06-22 19:53:41.195: E/AndroidRuntime(5374): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rse.jamesriver/com.rse.jamesriver.RSEanimation}: java.lang.NumberFormatException
06-22 19:53:41.195: E/AndroidRuntime(5374):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at android.os.Looper.loop(Looper.java:130)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at android.app.ActivityThread.main(ActivityThread.java:3687)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at java.lang.reflect.Method.invokeNative(Native Method)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at java.lang.reflect.Method.invoke(Method.java:507)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at dalvik.system.NativeStart.main(Native Method)
06-22 19:53:41.195: E/AndroidRuntime(5374): Caused by: java.lang.NumberFormatException
06-22 19:53:41.195: E/AndroidRuntime(5374):     at org.apache.harmony.luni.util.FloatingPointParser.parseFltImpl(Native Method)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at org.apache.harmony.luni.util.FloatingPointParser.parseFloat(FloatingPointParser.java:321)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at java.lang.Float.parseFloat(Float.java:323)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at android.content.res.TypedArray.getFloat(TypedArray.java:287)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at  06-22 19:53:41.195:E/AndroidRuntime(5374):  at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:110)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:106)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:83)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:64)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at com.rse.jamesriver.RSEanimation.onCreate(RSEanimation.java:25)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-22 19:53:41.195: E/AndroidRuntime(5374):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
从左到右

    <set xmlns:android="http://schemas.android.com/apk/res/android"
 android:shareInterpolator="false">
 <translate android:fromXDelta="-200%" android:toXDelta="0%"
         android:fromYDelta="0%" android:toYDelta="0%"
         android:duration="500"
         android:startOffset="100"/>
  </set>

从右到左

    <set xmlns:android="http://schemas.android.com/apk/res/android"
 android:shareInterpolator="false">
 <translate
 android:fromXDelta="0%" android:toXDelta="500%"
 android:fromYDelta="0%" android:toYDelta="0%"
 android:duration="700"
  android:startOffset="1000" />
 </set>

鳞片


您的问题在于
scale
元素的
scale.xml
文件中的
%
符号。这些不是必需的,因为这些属性的值需要是float,而不是string

<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator">
    <rotate
        android:toDegrees="720"
        android:duration="2000"
        android:pivotX="50%"
        android:pivotY="50%"/>
    <scale
        android:fromXScale="0.1"
        android:toXScale="100"
        android:fromYScale="0.1"
        android:toYScale="100"
        android:duration="2000"  
        android:startOffset="100"/>
</set>

您的问题在于
scale
元素的
scale.xml
文件中的
%
符号。这些不是必需的,因为这些属性的值需要是float,而不是string

<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator">
    <rotate
        android:toDegrees="720"
        android:duration="2000"
        android:pivotX="50%"
        android:pivotY="50%"/>
    <scale
        android:fromXScale="0.1"
        android:toXScale="100"
        android:fromYScale="0.1"
        android:toYScale="100"
        android:duration="2000"  
        android:startOffset="100"/>
</set>


请将
左\u到右.xml
右\u到左.xml
文件发布。在
RSEanimation.java
文件中,哪一行是数字25?Animation Animation=AnimationUtils.loadAnimation(这是R.anim.scale);如果愿意,也可以发布该文件,
scale.xml
。请将
left\u发布到right.xml
right\u发布到left.xml
文件。在
RSEanimation.java
文件中,哪一行是数字25?Animation Animation=AnimationUtils.loadAnimation(这是R.anim.scale);如果愿意,也可以发布该文件,
scale.xml