Java tutorial
//package com.java2s; //License from project: Open Source License import android.app.Activity; public class Main { public static void animFinish(Activity activity, int enterAnim, int exitAnim) { if (activity == null) { return; } activity.finish(); activity.overridePendingTransition(enterAnim, exitAnim); } }