use of com.andframe.activity.AfActivity in project AndFrameWorks by scwang90.
the class AfPagerManager method startActivity.
@Override
public void startActivity(Class<? extends Activity> clazz, Object... args) {
AfActivity activity = currentActivity();
if (activity != null && activity.isRecycled()) {
activity.startActivity(clazz, args);
} else {
AfApp app = AfApp.get();
AfIntent intent = new AfIntent(app, clazz);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putKeyVaules(args);
app.startActivity(intent);
}
}
use of com.andframe.activity.AfActivity in project AndFrameWorks by scwang90.
the class AfPagerManager method startForeground.
@Override
public void startForeground(Class<? extends AfActivity> clazz) {
AfActivity lastActivity = null;
while (mStackActivity.size() > 0) {
lastActivity = mStackActivity.peek();
if (clazz.isAssignableFrom(lastActivity.getClass())) {
return;
}
mStackActivity.pop().finish();
}
if (lastActivity != null) {
lastActivity.startActivity(clazz);
} else {
startActivity(clazz);
}
}
Aggregations