首页 > 代码库 > Android FragmentActivity Intent 跳转封装
Android FragmentActivity Intent 跳转封装
package com.innjoo.store.utils; import com.innjoo.store.R; import android.content.ActivityNotFoundException; import android.content.Intent; import android.support.v4.app.FragmentActivity; public class IntentUtils { private static Intent intent; private static final Object lock = new Object(); public static final int ENTER = 0, OUT = 1, NOTRANSITION = -1; /** * * @Title: startActivityEnter * @Description: TODO 跳转进入 * @return void * @throws * @author 重播 * @email 459821731@qq.com * @date 2014-12-18 上午10:05:16 */ public static <T> void startActivity(int inOrOut, FragmentActivity activity, Class<T> class1, String key, Object object) { // TODO Auto-generated method stub synchronized (lock) { try { intent = new Intent(activity, class1); if (object != null && object instanceof String) { intent.putExtra(key, (String) object); } else if (object != null && object instanceof Integer) { intent.putExtra(key, (Integer) object); } activity.startActivity(intent); switch (inOrOut) { case ENTER: activity.overridePendingTransition( R.anim.activity_right_in, R.anim.activity_left_out); break; case OUT: activity.overridePendingTransition(R.anim.activity_left_in, R.anim.activity_right_out); break; default: break; } } catch (ActivityNotFoundException e) { } } } }
Android FragmentActivity Intent 跳转封装
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。