public class VSession { private VSession() { } public static VSession getInstance() { if (session == null) session = new VSession(); return session; } // 跳转到主Activity public void exit(Activity activity) { Intent intent = new Intent(activity, MainActivity.class); activity.startActivity(intent); activity.overridePendingTransition(R.anim.push_right_in,R.anim.push_right_out); activity.finish(); } }
VSession.getInstance().exit(TextActivity.this);