开发者社区 问答 正文

安卓 getDrawable stopped

screenshot
getDrawable显示被弃用,按照网上的方法改一直改不好。然后打开虚拟机一直显示unfortunaly,项目has stopped。logcat里显示castexcption

展开
收起
爵霸 2016-05-30 09:37:16 1923 分享 版权
1 条回答
写回答
取消 提交回答
  • 替换成这一句试试,报错的贴一下报错代码。
    ResourcesCompat.getDrawable(getResources(), R.drawable.your_drawable, null)

    2019-07-17 19:19:02
    赞同 展开评论