android错误日子,Android错误集

1.错误提示:Error:Could not delete path 'C:\Users\Administrator.android\build-cache\4bcb944bb1b0acd2e173376f1b2cd7aaf97ca50c\output\aidl\android\support\v4'.

解决方式:手动删除 4bcb944bb1b0acd2e173376f1b2cd7aaf97ca50c 目录即可。

2.错误提示:Unable to create call adapter for io.reactivex。

原因:Retrofit暂时不支持RxJava2的适配器。

解决方式:导入新包

implementation 'com.squareup.retrofit2:adapter-rxjava2:latest.version' addCallAdapterFactory(RxJava2CallAdapterFactory.create())

3.错误提示:retrofit2.adapter.rxjava2.HttpException: HTTP 404 Not Found

原因:请求的完整API中有特殊字符,不能识别。

Process: com.huawei.mycenter, PID: 25953

java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true at

android.support.v7.widget.RecyclerView$Recycler.recycleViewHolderInternal(RecyclerView.java:5778) at

android.support.v7.widget.RecyclerView$Recycler.quickRecycleScrapView(RecyclerView.java:5885) at

原因:RecyclerView在进行切换数据之后,要调用 notifyDataSetChanged()方法。

5.ScrollView 内部子布局MATCH_PARENT却无法填充满屏幕。

android:fillViewport="true"

6.获取activity和屏幕的高度。

activity:

DisplayMetrics dm = context.getResources().getDisplayMetrics();

return dm.heightPixels;

屏幕显示的高度:

WindowManager wm = (WindowManager)

context.getSystemService(Context.WINDOW_SERVICE);

if (wm == null) {

return context.getResources().getDisplayMetrics().heightPixels;

}

Point point = new Point();

wm.getDefaultDisplay().getRealSize(point);

return point.y;

一直更新。。。。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值