更新时间:2023-01-13 11:52:48
在你的片段中使用这个:
Use this in your fragment:
private Context context;
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
context = activity;
}
然后在需要的地方使用 context
.
then use context
where you want.