Coder Social home page Coder Social logo

Comments (4)

JailedBird avatar JailedBird commented on May 28, 2024

问题稍微有点模糊,麻烦根据下面几个步骤确认下:
0、发一下跳转部分的代码
1、检查build文件下生成的对应代码, 根据经验判断有没问题(也可以发出来)
2、查看注入点是否忘记调用ARouter.getInstance().inject(this); 注入
3、更换mUrls模块的注解处理器为原生注解处理器, 然后看是否存在问题
4、将mUrls替换为MutableList, 看是否存在问题

from arouterkspcompiler.

JailedBird avatar JailedBird commented on May 28, 2024

貌似确实会出问题, 代码生成中区分了11中数据类型,8种基础类型Parcelable和Serializable, Object类(走Json解析方案,包括ArrayList等), 因此需要使用withObject传递参数
Arouter使用withObject传参需要自定义序列化工具:

参考:https://github.com/alibaba/ARouter#iv-advanced-usage

// If you need to pass a custom object, Create a new class(Not the custom object class),implement the SerializationService, And use the @Route annotation annotation, E.g:
@Route(path = "/yourservicegroupname/json")
public class JsonServiceImpl implements SerializationService {
    @Override
    public void init(Context context) {

    }

    @Override
    public <T> T json2Object(String text, Class<T> clazz) {
        return JSON.parseObject(text, clazz);
    }

    @Override
    public String object2Json(Object instance) {
        return JSON.toJSONString(instance);
    }
}

另外, 如果使用json方式完成对象解析, 如果字段内容为空可能会导致崩溃, 我会立即修复这个问题

from arouterkspcompiler.

JailedBird avatar JailedBird commented on May 28, 2024

image 获取到的数据是空的

请去README更新最新版本(xxx-1.0.2), 按照withObject传递参数即可, 可以去参考app模块的跳转传参示例😘

from arouterkspcompiler.

fuxuanyang11 avatar fuxuanyang11 commented on May 28, 2024

好的。 谢谢大佬

from arouterkspcompiler.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.