android intent跳转activity传递bundle

android intent跳转activity传递bundle,第1张

android intent跳转activity传递bundle

发送端:

Intent intent2 = new Intent(this,forget_pass_page.class);
                Bundle bundle = new Bundle();
                Player player = new Player(String.valueOf(username.getText()),String.valueOf(userpass.getText()));
                bundle.putParcelable("person",player);
                intent2.putExtras(bundle);
                startActivity(intent2);

接受端:

Bundle bundle = getIntent().getExtras();
Player player = (Player) bundle.getParcelable("person");

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5719567.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-18
下一篇 2022-12-18

发表评论

登录后才能评论

评论列表(0条)

保存