android - 片段不会立即被替换
问题描述
我多次使用具有不同数据的片段,但有时片段不会立即替换。
FunVideoFragment.prepareFun
(
videoSuggestionListNew.get(position).getEnTitle(),
videoSuggestionListNew.get(position).getFaTitle(),
videoSuggestionListNew.get(position).getLink(),
videoSuggestionListNew.get(position).getEnText(),
videoSuggestionListNew.get(position).getImage(),
String.valueOf(videoSuggestionListNew.get(position).getTopicCode()),
videoSuggestionListNew.get(position).getContentCode(),
videoSuggestionListNew.get(position).getCategory(),
videoSuggestionListNew.get(position).getTextPartOfSpeech(), "fun"
);
Log.e("parimah","start2");
Helper.fragmentInflater(new FunVideoFragment(), MainActivity.mContext);
和片段代码:
@SuppressLint("ClickableViewAccessibility")
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable final ViewGroup container, @Nullable Bundle savedInstanceState) {
Log.e("parimah","start3");
rootView = inflater.inflate(R.layout.fragment_fun_video, container, false);
initializing();
// some function
return rootview;
}
public static void prepareFun
(String enTitle, String faTitle, String url, String subtitle, String imageVideo, String topicCode, String contentCode, String category, String vocab, String type) {
videoEnTitle = enTitle;
videoFaTitle = faTitle;
videoUrl = url;
videoSubtitle = subtitle;
videoImage = imageVideo;
downloadedVideoName = topicCode + contentCode;
videoTopicCode = topicCode;
videoContentCode = contentCode;
videoCategory = category;
videoType = type;
videoVocab = vocab;
}
这有时会延迟。例如:
2020-05-16 18:45:59.576 11729-11729/ir.barmanrayan.tikkaa E/parimah: start2
2020-05-16 18:46:07.729 11729-11729/ir.barmanrayan.tikkaa E/parimah: start3
如何删除此延迟并立即显示片段?
解决方案
推荐阅读
- go - grpc server stops receiving messages after sending many messages simultaneously
- azure-devops - 启用自包含导致 dotnet 发布失败并使用私有 NuGet
- javascript - 400 error "You must pass a valid patch document in the body of the request."
- java - 检测 java web 应用程序中 cpu 使用率 15% 的原因
- python - 地理围栏根据距离和方位计算新的经度、纬度(Python - 库)
- azure - Can we copy Azure blobs from one storage account to other storage accounts in parallel from same machine?
- java - to disconnect the call programmatically in android for devices above Marshmallow
- java - 在 Sikuli 和 Selenium 之间切换时,如何导航到 Selenium 上一个会话中打开的确切页面?
- javascript - Angular 父子绑定更改检测
- python - 为 Python 3.4.1 安装 TextBlob