use of com.andframe.application.AfApp 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.application.AfApp in project AndFrameWorks by scwang90.
the class AfFragmentActivity method start.
// <editor-fold desc="跳转封装">
public static void start(Pager pager, Class<? extends Fragment> clazz, Object... params) {
// List<Object> list = new ArrayList<>(Arrays.asList(params));
// list.add(0, clazz.getName());
// list.add(0, EXTRA_FRAGMENT);
Context context = (pager instanceof Activity) ? (Activity) pager : (pager == null ? null : pager.getContext());
if (context != null) {
context.startActivity(newIntent(clazz, context, params));
} else {
AfApp app = AfApp.get();
app.startActivity(newIntent(clazz, app, params).newTask());
}
// pager.getContext().startActivity(new AfIntent(pager.getContext()));
// AfActivity activity = $.pager().currentActivity();
// if (activity != null) {
// (activity).startActivity(getActivityClazz(clazz), list.toArray());
// } else {
// AfApp app = AfApp.get();
// app.startActivity(new AfIntent(app, getActivityClazz(clazz),list.toArray()).newTask());
// }
}
Aggregations