search

Home  >  Q&A  >  body text

android - 在单元测试时,无法为Uri赋值。

使用这段代码为Uri赋值

Uri u =Uri.parse("content://com.ljq.provider.personprovider/person");

在Activity里成功了,但是在单元测试里uri为空。这是为什么,有什么办法能成功赋值。

黄舟黄舟2771 days ago563

reply all(1)I'll reply

  • 黄舟

    黄舟2017-04-17 17:27:10

    There is no problem in terms of assignment. There must be other reasons why it is empty. Review your code carefully and log and analyze before and after modifying the uri

    reply
    0
  • Cancelreply