You cannot use overridePendingTransition in Android 1.5. overridePendingTransistion came to Android 2.0.
If you're gonna go through this without any error you have to compile for the target (1.5 or higher) using the ordinary animations (or you own) or you have to compile for the target (2.0 or higher) using overridePendingTransistion.
Summary: You cannot use overridePendingTransistion in Android 1.5.
You can though use the built-in animations in the OS.
Some versions of Android support custom Activity transitions and some don't (older devices). If you want to use custom transitions it's good practice to check whether the Activity has the overridePendingTransition() method, as on older versions it does not.
To know whether the method exists or not, reflection API can be used. Here is the simple code which will check and return the method if it exists:
Method mOverridePendingTransition;
try {
mOverridePendingTransition = Activity.class.getMethod(
"overridePendingTransition", new Class[] { Integer.TYPE, Integer.TYPE } );
/* success */
} catch (NoSuchMethodException nsme) {
/* failure, this version of Android doesn't have this method */
}
And then, we can apply our own transition, i.e. use this method if it exists:
Intent i = new Intent(getApplicationContext(), LoginActivity.class);
overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);
startActivity(i);
finish();