[Solved] Android Application idea how to achieve this [closed]


This post features how to change Android’s default animation when switching between Activities. Before reading the rest, please know that the code that changes the standard animation be found at the API Demo that comes with the Android SDK. But since there’s a lack of proper documentation regarding this subject and it’s difficult to find a place explaining it, here is a post that helps in aiding these two problems. So, the code to change the animation between two Activities is very simple: just call the overridePendingTransition() from the current Activity, after starting a new Intent. This method is available from Android version 2.0 (API level 5), and it takes two parameters, that are used to define the enter and exit animations of your current Activity.

//Calls a new Activity  
startActivity(new Intent(this, NewActivity.class));  

//Set the transition -> method available from Android 2.0 and beyond  
overridePendingTransition(R.anim.push_left_in,R.anim.push_up_out);   

These two parameters are resource IDs for animations defined with XML files (one for each animation). These files have to be placed inside the app’s res/anim folder. Examples of these files can be found at the Android API demo, inside the anim folder. Let’s take a look at one of these files (push_left_in.xml):

<?xml version="1.0" encoding="utf-8"?>  
<set xmlns:android="http://schemas.android.com/apk/res/android">  
  <translate android:fromXDelta="100%p" android:toXDelta="0" android:duration="300"/>  
  <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="300" />  
</set> 

solved Android Application idea how to achieve this [closed]