打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
简单的跳转,哎!

1:       //话说页面的跳转一定要注意:manifest  <慎之……慎之>

           Intent intent = new Intent(main.this, index.class);

           /* 通过Bundle对象存储需要传递的数据 */          此方法同样支持动态添加组件(不用XML)的页面跳转,当然manifest  <慎之……慎之>必须申明的

           Bundlebundle = new Bundle();

           /*字符、字符串、布尔、字节数组、浮点数等等,都可以传*/

           bundle.putString("Name","gql");

           bundle.putBoolean("pass",true);

           /*bundle对象assignIntent*/

           intent.putExtras(bundle); 

           startActivity(intent); 

 

    得到传递的数据

this.getIntent().getStringExtra("name");//"方法直接从Intent中获取数据。

          /*获取Intent中的Bundle对象*/

        Bundle bundle = this.getIntent().getExtras();

        

        /*获取Bundle中的数据,注意类型和key*/

        String name =bundle.getString("Name");

        boolean pass =bundle.getBoolean("pass");

     

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
【Android基础】页面跳转与传值(Activity跳转与传值)
2.Activity之间传递参数
Android开发中插入新的Activity
android不同Activity之间的数据共享
Android?Bundle?使用
android中intent传递list或者对象的方法
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服