简化开发

Arouter拦截器处理页面启动模式

2022-01-26  本文已影响0人  咚咚_Coding
@Interceptor(priority = 12, name = "路由拦截")
public class MidderProductInterceptor implements IInterceptor {

private Context mContext;

@Override
public void process(Postcard postcard, InterceptorCallback callback) {
        //未登陆&是订单详情  那么登陆并跳转
        if (postcard.getPath().equals("/experience/midder_product_contrast")) {
            postcard.withFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
        }
        callback.onContinue(postcard);
}

@Override
public void init(Context context) {
    this.mContext = context;
}

}

上一篇 下一篇

猜你喜欢

热点阅读