<分区>
我有一个带有适配器的 Activity extends RecyclerView.Adapter<UserProfileAdapter.ViewHolder>
.问题是,当用户单击其中一个列表项中的“自动链接”时,出现以下异常:
在我的 UserProfileActivity 中,我像他一样实例化我的适配器:
UserProfileAdapter adapter = new UserProfileAdapter(getApplicationContext(), posts);
在适配器中,我像这样检索上下文:
private Context mContext;
private List<ParseObject> mYeets;
private UserProfileAdapter adapter;
public UserProfileAdapter(Context context, List<ParseObject> yeets) {
super();
this.mYeets = yeets;
this.mContext = context;
this.adapter = this;
}
如何确保自动链接的文本不会产生此错误?由于没有与链接/Intent 关联的代码,我该怎么办?