Android Application Stops When Animation Added

dramatrauma

New Member
i am beginner in android and coding small game Intro screen. My problem is that when i add some basic animation to intro screen there is no output and application stops with popup like this
2zwHd.png
,and when i comment animation method it shows simple xml based layouts please help me where is problem here is my java file \[code\]public class MainActivity extends Activity {TextView logo ;TextView bottom ; @Overrideprotected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); animate();}public void animate(){ logo= (TextView) findViewById(R.id.toplogo); bottom =(TextView) findViewById(R.id.footer); Animation fade1= AnimationUtils.loadAnimation(this, R.anim.fade_in); logo.setAnimation(fade1); Animation fade2= AnimationUtils.loadAnimation(this, R.anim.fade_in2); bottom.setAnimation(fade2); fade2.setAnimationListener(new AnimationListener(){ @Override public void onAnimationEnd(Animation animation) { startActivity(new Intent(MainActivity.this, Menu.class)); MainActivity.this.finish(); } @Override public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub }} ); } public void onpause(){ super.onPause(); logo.clearAnimation(); bottom.clearAnimation(); }public void onResume(){ super.onResume(); animate();}\[/code\]}\[code\]activity_main.xml file<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"android:background="@android:color/black"><TextView android:id="@+id/toplogo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello_world" android:textColor="@color/logoname" android:gravity="top|center" android:textSize="@dimen/logosize" /><TableLayout android:id="@+id/TableLayout01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:stretchColumns="*" > <TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|center_horizontal" android:minHeight="150px" > <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_gravity="center_vertical|center_horizontal" android:src="http://stackoverflow.com/questions/15855357/@drawable/splash1" /> <ImageView android:id="@+id/imageView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|center_horizontal" android:src="http://stackoverflow.com/questions/15855357/@drawable/splash2" /> </TableRow> <TableRow android:id="@+id/tableRow2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minHeight="150px" > <ImageView android:id="@+id/imageView3" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_gravity="center_vertical|center_horizontal" android:src="http://stackoverflow.com/questions/15855357/@drawable/splash3" /> <ImageView android:id="@+id/imageView4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|center_horizontal" android:src="http://stackoverflow.com/questions/15855357/@drawable/splash4" /> </TableRow></TableLayout><TextView android:id="@+id/footer" android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="@color/logoname" android:textSize="@dimen/logosize" android:text="Done That " android:gravity="bottom|center" android:minHeight="120px" > </TextView> </LinearLayout>\[/code\]animation files \[code\] fade_in2.xml <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false"> <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="2500" android:startOffset="2500"> </alpha> </set >\[/code\]and same way \[code\]fade_in.xml\[/code\] etc. please help me with the problem whats wrong with the logic/code that its not working with \[code\]animation\[/code\] .. EDIT Error log ..i am not sure if i copied requred one or not please see this one ( i did select error in drop down from logcat tab)\[code\]04-06 20:18:25.996: E/AndroidRuntime(812): FATAL EXCEPTION: main04-06 20:18:25.996: E/AndroidRuntime(812): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.simplegame/android.view.Menu}; have you declared this activity in your AndroidManifest.xml?04-06 20:18:25.996: E/AndroidRuntime(812): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1618)04-06 20:18:25.996: E/AndroidRuntime(812): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1417)04-06 20:18:25.996: E/AndroidRuntime(812): at android.app.Activity.startActivityForResult(Activity.java:3370)04-06 20:18:25.996: E/AndroidRuntime(812): at android.app.Activity.startActivityForResult(Activity.java:3331)04-06 20:18:25.996: E/AndroidRuntime(812): at android.app.Activity.startActivity(Activity.java:3566)04-06 20:18:25.996: E/AndroidRuntime(812): at android.app.Activity.startActivity(Activity.java:3534)04-06 20:18:25.996: E/AndroidRuntime(812): at com.example.simplegame.MainActivity$1.onAnimationEnd(MainActivity.java:41)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.animation.AnimationSet.getTransformation(AnimationSet.java:400)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.animation.Animation.getTransformation(Animation.java:940)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.View.drawAnimation(View.java:13205)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.View.draw(View.java:13344)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.ViewGroup.drawChild(ViewGroup.java:2928)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.View.draw(View.java:13715)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.View.draw(View.java:13596)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.ViewGroup.drawChild(ViewGroup.java:2928)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.View.draw(View.java:13715) 04-06 20:18:25.996: E/AndroidRuntime(812): at android.widget.FrameLayout.draw(FrameLayout.java:467)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.View.draw(View.java:13596)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.ViewGroup.drawChild(ViewGroup.java:2928)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.View.draw(View.java:13594)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.ViewGroup.drawChild(ViewGroup.java:2928)04-06 20:18:25.996: E/AndroidRuntime(812): at an droid.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.View.draw(View.java:13715)04-06 20:18:25.996: E/AndroidRuntime(812): at android.widget.FrameLayout.draw(FrameLayout.java:467)04-06 20:18:25.996: E/AndroidRuntime(812): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2211)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2281)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2177)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2045)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1854)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.Choreographer.doCallbacks(Choreographer.java:562)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.Choreographer.doFrame(Choreographer.java:532)04-06 20:18:25.996: E/AndroidRuntime(812): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)04-06 20:18:25.996: E/AndroidRuntime(812): at android.os.Handler.handleCallback(Handler.java:725)04-06 20:18:25.996: E/AndroidRuntime(812): at android.os.Handler.dispatchMessage(Handler.java:92)04-06 20:18:25.996: E/AndroidRuntime(812): at android.os.Looper.loop(Looper.java:137)04-06 20:18:25.996: E/AndroidRuntime(812): at android.app.ActivityThread.main(ActivityThread.java:5041)04-06 20:18:25.996: E/AndroidRuntime(812): at java.lang.reflect.Method.invokeNative(Native Method)04-06 20:18:25.996: E/AndroidRuntime(812): at java.lang.reflect.Method.invoke(Method.java:511)04-06 20:18:25.996: E/AndroidRuntime(812): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)04-06 20:18:25.996: E/AndroidRuntime(812): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)04-06 20:18:25.996: E/AndroidRuntime(812): at dalvik.system.NativeStart.main(Native Method)\[/code\]
 
Back
Top