为什么 bundle 在对话框中为空?

如何解决为什么 bundle 在对话框中为空?

你好,我在两个对话框之间传递包。在我的第一个对话框中,我将字符串放在一个包中,它们不为空。在我的第二个对话框中,我尝试获取捆绑包并将它们放入字符串中,但捆绑包为空。我之前管理过发送包,但现在使用相同的代码它不起作用并且在第二个片段中为空。 怎么了?

第一个片段

<div class="pageContent broaden">
                    <div class="container">
                        <div class="element centered">
                            <button style="background: rgb(3,182,252);">
                                <svg width="40" height="40" viewBox="0 0 512 512">
                                    <g style="fill: #fff;">
                                        <g>
                                            <path d="M493.09 351.3L384.7 304.8a31.36 31.36 0 0 0-36.5 8.9l-44.1 53.9A350 350 0 0 1 144.5 208l53.9-44.1a31.35 31.35 0 0 0 8.9-36.49l-46.5-108.5A31.33 31.33 0 0 0 125 .81L24.2 24.11A31.05 31.05 0 0 0 0 54.51C0 307.8 205.3 512 457.49 512A31.23 31.23 0 0 0 488 487.7L511.19 387a31.21 31.21 0 0 0-18.1-35.7zM456.89 480C222.4 479.7 32.3 289.7 32.1 55.21l99.6-23 46 107.39-72.8 59.5C153.3 302.3 209.4 358.6 313 407.2l59.5-72.8 107.39 46z"></path>
                                        </g>
                                    </g>
                                </svg>
                            </button>
                            <span>Call Summit Support on <a href="tel:0400000000">0400 000 000</a> at any time.</span>
                            <span><b>Primary Student Contact:</b> Mr Tom Carpenter</span>
                        </div>
                        <div class="element centered">
                            <button style="background: rgb(139,195,74);">
                                <svg width="40" height="40" viewBox="0 0 512 512">
                                    <g style="fill: #fff;">
                                        <g>
                                            <path d="M464 64H48C21.5 64 0 85.5 0 112v288c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM48 96h416c8.8 0 16 7.2 16 16v41.4c-21.9 18.5-53.2 44-150.6 121.3-16.9 13.4-50.2 45.7-73.4 45.3-23.2.4-56.6-31.9-73.4-45.3C85.2 197.4 53.9 171.9 32 153.4V112c0-8.8 7.2-16 16-16zm416 320H48c-8.8 0-16-7.2-16-16V195c22.8 18.7 58.8 47.6 130.7 104.7 20.5 16.4 56.7 52.5 93.3 52.3 36.4.3 72.3-35.5 93.3-52.3 71.9-57.1 107.9-86 130.7-104.7v205c0 8.8-7.2 16-16 16z"></path>
                                        </g>
                                    </g>
                                </svg>
                            </button>
                            <span>Email Summit Support on <a href="mailto:support@summitlms.com">support@summitlms.com</a> or complete the webform contained within the Help button located at the bottom of the left navigation pane for assistance.</span>
                        </div>
                        <div class="element centered">
                            <button style="background: rgb(255,87,34);">
                                <svg width="40" height="40" viewBox="0 0 448 512">
                                    <g style="fill: #fff;">
                                        <g>
                                            <path d="M224 32c106 0 192 28.75 192 64v32c0 35.25-86 64-192 64S32 163.25 32 128V96c0-35.25 86-64 192-64m192 149.5V224c0 35.25-86 64-192 64S32 259.25 32 224v-42.5c41.25 29 116.75 42.5 192 42.5s150.749-13.5 192-42.5m0 96V320c0 35.25-86 64-192 64S32 355.25 32 320v-42.5c41.25 29 116.75 42.5 192 42.5s150.749-13.5 192-42.5m0 96V416c0 35.25-86 64-192 64S32 451.25 32 416v-42.5c41.25 29 116.75 42.5 192 42.5s150.749-13.5 192-42.5M224 0C145.858 0 0 18.801 0 96v320c0 77.338 146.096 96 224 96 78.142 0 224-18.801 224-96V96c0-77.338-146.096-96-224-96z"></path>
                                        </g>
                                    </g>
                                </svg>
                            </button>
                            <span><a href="#">Click here</a> to access the external Summit knowledge base to access guides in relation to assistance in using the Summit software package.</span>
                        </div>
                    </div>
                    <div class="container">
                        <div class="element">
                            <div class="header"><h1>Current release:</h1></div>
                            <div class="main">
                                <ul>
                                    <li><b>Summit Suite 2021.1:</b> Welcome to the 2021.1 release of the Summit Suite. This release includes detailed information and processes on all the new functionality,changes and bug fixes. Please <a href="#" target="_blank">click here</a> to view the release notes.</li>
                                </ul>
                            </div>
                        </div>
                        <div class="element">
                            <div class="header"><h1>Past releases:</h1></div>
                            <div class="main">
                                <p style="text-align: center;"><i>There are no past releases available to view.</i></p>
                            </div>
                        </div>
                    </div>

我的第二个片段

EditText userName,emailAddress,password,repeat;
Button register;
String isntequal;
String pwtoshort;
String wrongEmail;


private static final String TAG = "Register";

TextView openlog,wrongpw,wrongemail;

public static void display(FragmentManager fragmentManager) {
    Registration registration = new Registration();
   registration.show(fragmentManager,TAG);
}



@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setStyle(DialogFragment.STYLE_NORMAL,R.style.AppTheme_FullScreenDialog);

}

@Override
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_registration,container,false);

    wrongEmail= getString(R.string.wrongemail);
    pwtoshort=getString(R.string.pwtoshort);
    isntequal= getString(R.string.isntequal);


    wrongemail= view.findViewById(R.id.wrongemail);
    wrongpw= view.findViewById(R.id.isntequals);
    userName = view.findViewById(R.id.name);
    emailAddress = view.findViewById(R.id.EmailAddress);
    password = view.findViewById(R.id.Password);
    repeat = view.findViewById(R.id.repeatPassword);
    register = view.findViewById(R.id.createaccout);

    userName.addTextChangedListener(loginTextWatcher);
    emailAddress.addTextChangedListener(loginTextWatcher);
    password.addTextChangedListener(loginTextWatcher);
    repeat.addTextChangedListener(loginTextWatcher);


    register.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            final String username = userName.getText().toString();
            final String email = emailAddress.getText().toString();
            final String Password = password.getText().toString();
            final String Repeat = repeat.getText().toString();
            if(!(Password.equals(Repeat))){
                wrongpw.setText(isntequal);
                wrongpw.setVisibility(View.VISIBLE);

            }
            else if (Password.length()< 8){
                wrongpw.setText(pwtoshort);
                wrongpw.setVisibility(View.VISIBLE);

            }

            else if (!isEmailValid(email)){
                wrongemail.setText(wrongEmail);
                wrongemail.setVisibility(View.VISIBLE);
            }

            else {
                dismiss();
                Bundle bundle=  new Bundle();
                accountverify accountVerify = new accountverify();
                bundle.putString("username",username);
                bundle.putString("email",email);
                Log.d(TAG,"onClick: Hello"+bundle);
                accountverify.display(getActivity().getSupportFragmentManager());
                accountVerify.setArguments(bundle);



            }
        }

    });

解决方法

您的 accountverify#display() 正在实例化一个要显示的新实例,它与您设置参数包的实例不同。你没有对带参数的实例做任何事情。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)&gt; insert overwrite table dwd_trade_cart_add_inc &gt; select data.id, &gt; data.user_id, &gt; data.course_id, &gt; date_format(
错误1 hive (edu)&gt; insert into huanhuan values(1,&#39;haoge&#39;); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive&gt; show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 &lt;configuration&gt; &lt;property&gt; &lt;name&gt;yarn.nodemanager.res