miserydx / FakeBiliBili

仿B站Android端项目

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

运行问题

Chexian1 opened this issue · comments

我运行之后这个软件闪退,没有数据 控制台报了一个空指针错误 好像是缺失url 请问怎么解决?是服务器不提供数据么,我该如何获取数据呢?

public class ImageUtil {

public static final String TAG = ImageUtil.class.getSimpleName();

public static void load(GenericDraweeView draweeView, String url, int width, int height) {
   //增加url判断非空的代码
    if (url == null) {
        return;
    }
    Uri uri = Uri.parse(url);
    ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri)
            .setResizeOptions(new ResizeOptions(width, height))
            .build();
    DraweeController controller = Fresco.newDraweeControllerBuilder()
            .setImageRequest(request)
            .setOldController(draweeView.getController())
            .build();
    draweeView.setController(controller);
}

}