《skill》系列日剧:一场穿越时空的太空太阳奇幻之旅

核心内容摘要

欧美一二三:品味世界的多元魅力
苏畅我回来了EP2在线播放视频:一场治愈心灵的温情回归

申鹤翻白眼流眼泪:一场心绪的潮汐,一场无声的呐喊

intent.replaceExtras((Bundle) null); // 清除所有extra数据说是可以清除现在来做个实验看看能不能清除Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View viewinflater.inflate(R.layout.fragment_test,container,false); Button buttonview.findViewById(R.id.button

; button.setOnClickListener(new View.OnClickListener() { Override public void onClick(View v) { Intent intent new Intent(v.getContext(), MainActivity.class); intent.putExtra(tab,second); intent.replaceExtras((Bundle) null); intent.addFlags(FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NEW_DOCUMENT); startActivity(intent); } }); // Inflate the layout for this fragment return view; }如果能清除就会跳转到第一个界面清除不了就会跳转到第二个界面跳转到了第一个界面说明确实清除了但是为了证明是清除了现在去掉这一句看是不是会跳转到第二个界面Intent intent new Intent(v.getContext(), MainActivity.class); intent.putExtra(tab,second); intent.addFlags(FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NEW_DOCUMENT); startActivity(intent);非常遗憾还是跳转到了第一个界面这说明是逻辑设计错误首先需要修复逻辑我们发现是getIntent判断位置错误应该放在onResume里面而不是oncREATE()从这2个图片可以看出这个语句确实清除了intent里面的数据不用再证明了已经看到了。

豆花官网进入免费-豆花官网进入免费应用

百度百家号客服电话人工服务

123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123