Java Code Examples for com.alibaba.android.arouter.facade.callback.InterceptorCallback#onInterrupt()
The following examples show how to use
com.alibaba.android.arouter.facade.callback.InterceptorCallback#onInterrupt() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LoginInterceptor.java From JD-Test with Apache License 2.0 | 5 votes |
@Override public void process(Postcard postcard, InterceptorCallback callback) { if(!CommonConfig.LOGIN){ callback.onInterrupt(null); ARouter.getInstance().build("/test/login").greenChannel().navigation(); } else{ callback.onContinue(postcard); } }
Example 2
Source File: ActivityInterceptor.java From NGA-CLIENT-VER-OPEN-SOURCE with GNU General Public License v2.0 | 5 votes |
@Override public void process(Postcard postcard, InterceptorCallback interceptorCallback) { if (UserManagerImpl.getInstance().getActiveUser() == null) { String path = postcard.getPath(); for (String activity : ARouterConstants.ACTIVITY_NEED_LOGIN) { if (activity.equals(path)) { interceptorCallback.onInterrupt(new Exception("未登录")); ARouter.getInstance().build(ARouterConstants.ACTIVITY_LOGIN).navigation(); return; } } } interceptorCallback.onContinue(postcard); }