gpt4 book ai didi

android - 回收站 View xamarin 中未处理的异常

转载 作者:行者123 更新时间:2023-11-29 23:24:51 24 4
gpt4 key购买 nike

当我点击 recyclerview 时,应用程序已停止并显示错误消息

Unhandled Exception: Java.Lang.LinkageError: no method with name='getContext' signature='()Landroid/content/Context;' in class Landroid/app/Fragment;"

enter image description here...

你知道怎么解决吗?

最佳答案

使用托管 fragment 的 Activity 作为您的上下文:

var context = fragment.Activity;

因此您的 LinearLayoutManager .ctor 将是:

... = new LinearLayoutManager(this.Activity, ....

注意:不要不要将图像用于代码,将格式化的文本直接添加到您的问题中。

关于android - 回收站 View xamarin 中未处理的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53756654/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com