posts - 296,comments - 1,views - 2915

一.所花时间

1h

二.代码量

30行

三.博客量

1篇

四.了解到的知识点

// 创建一个意图对象,准备跳到指定的活动页面
Intent intent = new Intent(this, ActReceiveActivity.class);
 Bundle bundle = new Bundle();  // 创建一个新包裹
// 往包裹存入名为request_time的字符串
bundle.putString("request_time", DateUtil.getNowTime());
 // 往包裹存入名为request_content的字符串
bundle.putString("request_content", tv_send.getText().toString());
 intent.putExtras(bundle);  // 把快递包裹塞给意图


startActivity(intent);  // 跳转到意图指定的活动页面
// 从布局文件中获取名为tv_receive的文本视图
TextView tv_receive = findViewById(R.id.tv_receive);
 // 从上一个页面传来的意图中获取快递包裹
Bundle bundle = getIntent().getExtras();
 // 从包裹中取出名为request_time的字符串
String request_time = bundle.getString("request_time");
 // 从包裹中取出名为request_content的字符串
String request_content = bundle.getString("request_content");
 String desc = String.format("收到请求消息:\n请求时间为%s\n请求内容为%s",
 request_time, request_content);
 tv_receive.setText(desc);  // 把请求消息的详情显示在文本视图上

 

posted on   leapss  阅读(3)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· winform 绘制太阳,地球,月球 运作规律
· 上周热点回顾(3.3-3.9)
历史上的今天:
2023-04-19 每日打卡-8.2
2023-04-19 每日打卡-8.1
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示