Search in sources :

Example 1 with AfActivity

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);
    }
}
Also used : AfActivity(com.andframe.activity.AfActivity) AfApp(com.andframe.application.AfApp) AfIntent(com.andframe.feature.AfIntent)

Example 2 with AfActivity

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);
    }
}
Also used : AfActivity(com.andframe.activity.AfActivity)

Aggregations

AfActivity (com.andframe.activity.AfActivity)2 AfApp (com.andframe.application.AfApp)1 AfIntent (com.andframe.feature.AfIntent)1