本文整理汇总了Java中org.holoeverywhere.app.Activity.overridePendingTransition方法的典型用法代码示例。如果您正苦于以下问题:Java Activity.overridePendingTransition方法的具体用法?Java Activity.overridePendingTransition怎么用?Java Activity.overridePendingTransition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.holoeverywhere.app.Activity
的用法示例。
在下文中一共展示了Activity.overridePendingTransition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restartWithTheme
import org.holoeverywhere.app.Activity; //导入方法依赖的package包/类
/**
* Like {@link #restartWithTheme(Activity, int)}, but if third arg is true -
* restart activity regardless theme.
*
* @param activity Activity
* @param theme Theme flags for check
* @param force Force restart activity
*/
@SuppressLint("InlinedApi")
public static void restartWithTheme(Activity activity, int theme, boolean force) {
if (theme < _START_RESOURCES_ID && theme > 0) {
if (ThemeManager._THEME_MODIFIER > 0) {
theme |= ThemeManager._THEME_MODIFIER;
}
theme &= ThemeManager._THEME_MASK;
}
if (force || ThemeManager.getTheme(activity) != theme) {
Intent intent = new Intent(activity.getIntent());
intent.setClass(activity, activity.getClass());
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
if (theme > 0) {
intent.putExtra(ThemeManager._THEME_TAG, theme);
}
intent.putExtra(KEY_INSTANCE_STATE, activity.saveInstanceState());
intent.putExtra(KEY_CREATED_BY_THEME_MANAGER, true);
if (activity.isRestricted()) {
Application app = Application.getLastInstance();
if (app != null && !app.isRestricted()) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
app.superStartActivity(intent, -1, null);
}
} else {
if (!activity.isFinishing()) {
activity.finish();
activity.overridePendingTransition(0, 0);
}
if (activity != null) {
activity.superStartActivity(intent, -1, null);
}
}
}
}
示例2: restartWithTheme
import org.holoeverywhere.app.Activity; //导入方法依赖的package包/类
/**
* Like {@link #restartWithTheme(Activity, int)}, but if third arg is true -
* restart activity regardless theme.
*
* @param activity Activity
* @param theme Theme flags for check
* @param force Force restart activity
*/
@SuppressLint("InlinedApi")
public static void restartWithTheme(Activity activity, int theme, boolean force) {
if (theme < _START_RESOURCES_ID && theme > 0) {
if (ThemeManager._THEME_MODIFIER > 0) {
theme |= ThemeManager._THEME_MODIFIER;
}
theme &= ThemeManager._THEME_MASK;
}
if (force || ThemeManager.getTheme(activity) != theme) {
Intent intent = new Intent(activity.getIntent());
intent.setClass(activity, activity.getClass());
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
if (theme > 0) {
intent.putExtra(ThemeManager._THEME_TAG, theme);
}
intent.putExtra(KEY_INSTANCE_STATE, activity.saveInstanceState());
intent.putExtra(KEY_CREATED_BY_THEME_MANAGER, true);
if (activity.isRestricted()) {
Application app = Application.getLastInstance();
if (app != null && !app.isRestricted()) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
app.superStartActivity(intent, -1, null);
}
} else {
if (!activity.isFinishing()) {
activity.finish();
activity.overridePendingTransition(0, 0);
}
if (activity instanceof SuperStartActivity) {
((SuperStartActivity) activity).superStartActivity(intent,
-1, null);
} else {
activity.startActivity(intent);
}
}
}
}