{"id":1799,"date":"2022-08-30T15:19:32","date_gmt":"2022-08-30T15:19:32","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/12\/02\/animation-keeps-crashing-on-a-samsung-galaxy-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:19:32","modified_gmt":"2022-08-30T15:19:32","slug":"animation-keeps-crashing-on-a-samsung-galaxy-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/animation-keeps-crashing-on-a-samsung-galaxy-collection-of-common-programming-errors\/","title":{"rendered":"Animation keeps crashing on a samsung galaxy-Collection of common programming errors"},"content":{"rendered":"<p>Im having a issue were my app keeps crashing on an animation I&#8217;m attempting to do. It works fine on my Razr version 4.1.2 but on the galaxy it crashes with a <code>NumberFormatException<\/code> it has version 2.3.6.<\/p>\n<p>Can anyone tell my why this is crashing? I am still trying to figure out if this is a sdk version issue. Also I tried to install my signed .apk on a samsung S3 and it wont even install. It just gives me a blank screen. This seems to only be an issue with Samsung phones.<\/p>\n<pre><code>    public class RSEanimation extends Activity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);     \n        super.setContentView(R.layout.startup);\n        final ImageView animationTarget1 = (ImageView) this.findViewById(R.id.rseImage);\n        final TextView animationTarget2 = (TextView) this.findViewById(R.id.textView1);\n        final TextView animationTarget3 = (TextView) this.findViewById(R.id.textView2);\n        final TextView animationTarget4 = (TextView) this.findViewById(R.id.textView3);\n        Animation animation = AnimationUtils.loadAnimation(this, R.anim.scale);\n        final Animation animation1 = AnimationUtils.loadAnimation(this, R.anim.left_to_right);\n        final Animation animation2 = AnimationUtils.loadAnimation(this, R.anim.left_to_right);\n        final Animation animation3 = AnimationUtils.loadAnimation(this, R.anim.left_to_right);\n        final Animation animation4 = AnimationUtils.loadAnimation(this, R.anim.right_to_left);\n        animationTarget1.startAnimation(animation);\n        animationTarget4.setVisibility(View.VISIBLE);\n        animationTarget4.startAnimation(animation1);        \n\n        animation1.setAnimationListener(new AnimationListener() {\n            @Override\n            public void onAnimationStart(Animation animation) {}\n            @Override\n            public void onAnimationRepeat(Animation animation) {} \n            @Override\n            public void onAnimationEnd(Animation animation) {\n                animationTarget3.setVisibility(View.VISIBLE);\n                animationTarget3.startAnimation(animation2);\n            }\n        });\n        animation2.setAnimationListener(new AnimationListener() {\n            @Override\n            public void onAnimationStart(Animation animation) {}\n            @Override\n            public void onAnimationRepeat(Animation animation) {}\n            @Override\n            public void onAnimationEnd(Animation animation) {\n                animationTarget2.setVisibility(View.VISIBLE);\n                animationTarget2.startAnimation(animation3);\n            }\n        });\n        animation3.setAnimationListener(new AnimationListener() {\n            @Override\n            public void onAnimationStart(Animation animation) {}\n\n            @Override\n            public void onAnimationRepeat(Animation animation) {\n            }\n            @Override\n            public void onAnimationEnd(Animation animation) {\n                animationTarget1.startAnimation(animation4);\n                animationTarget2.startAnimation(animation4);\n                animationTarget3.startAnimation(animation4);\n                animationTarget4.startAnimation(animation4);\n            }\n        });\n        animation4.setAnimationListener(new AnimationListener() {\n            @Override\n            public void onAnimationStart(Animation animation) {}\n\n            @Override\n            public void onAnimationRepeat(Animation animation) {\n            }\n\n            @Override\n            public void onAnimationEnd(Animation animation) {\n                animationTarget1.setVisibility(View.INVISIBLE);\n                animationTarget2.setVisibility(View.INVISIBLE);\n                animationTarget3.setVisibility(View.INVISIBLE);\n                animationTarget4.setVisibility(View.INVISIBLE);\n                 RSEanimation.this.startActivity(new Intent(RSEanimation.this, RiverConditionsActivity.class));\n\n            }\n        });\n\n\n       }\n\n     @Override\n        public void onRestart() {\n              super.onRestart();   \n                  finish();\n     }\n    }\n<\/code><\/pre>\n<p>logcat:<\/p>\n<pre><code>06-22 19:53:41.164: W\/ResourceType(5374): Entry identifier 0x12c is larger than entry count 0xac\n06-22 19:53:41.187: W\/Resources(5374): Converting to float: TypedValue{t=0x6\/d=0x20c530 a=-1}\n06-22 19:53:41.187: W\/dalvikvm(5374): threadid=1: thread exiting with uncaught exception (group=0x40015578)\n06-22 19:53:41.195: E\/AndroidRuntime(5374): FATAL EXCEPTION: main\n06-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\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at android.os.Handler.dispatchMessage(Handler.java:99)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at android.os.Looper.loop(Looper.java:130)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at android.app.ActivityThread.main(ActivityThread.java:3687)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at java.lang.reflect.Method.invokeNative(Native Method)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at java.lang.reflect.Method.invoke(Method.java:507)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at dalvik.system.NativeStart.main(Native Method)\n06-22 19:53:41.195: E\/AndroidRuntime(5374): Caused by: java.lang.NumberFormatException\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at org.apache.harmony.luni.util.FloatingPointParser.parseFltImpl(Native Method)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at org.apache.harmony.luni.util.FloatingPointParser.parseFloat(FloatingPointParser.java:321)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at java.lang.Float.parseFloat(Float.java:323)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at android.content.res.TypedArray.getFloat(TypedArray.java:287)\n06-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)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:106)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:83)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:64)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at com.rse.jamesriver.RSEanimation.onCreate(RSEanimation.java:25)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)\n06-22 19:53:41.195: E\/AndroidRuntime(5374):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)\n<\/code><\/pre>\n<p>Left_to_Right<\/p>\n<pre><code>    \n \n  \n<\/code><\/pre>\n<p>Right_to_Left<\/p>\n<pre><code>    \n \n \n<\/code><\/pre>\n<p>Scale<\/p>\n<pre><code>    \n \n \n\n \n<\/code><\/pre>\n<ol>\n<li>\n<p>Your problem is with the <code>%<\/code> signs in the <code>scale.xml<\/code> file for the <code>scale<\/code> element. Those are not required as the value of those attributes needs to be float, not string.<\/p>\n<pre><code>\n    \n    \n\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-12-02 01:34:44. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Im having a issue were my app keeps crashing on an animation I&#8217;m attempting to do. It works fine on my Razr version 4.1.2 but on the galaxy it crashes with a NumberFormatException it has version 2.3.6. Can anyone tell my why this is crashing? I am still trying to figure out if this is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1799","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1799"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1799\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}