当前位置: 首页 > news >正文

酒店网站建设案例购物网站建设论文答辩

酒店网站建设案例,购物网站建设论文答辩,网络营销是不是网络推广,一个人可以备案几个网站概述 在Android中#xff0c;Intent是各个组件之间信息通信的桥梁#xff0c;它用于Android各组件的通信。 Intent 的组成部分 一、显式 Intent 第一种方式 Intent intent new Intent(this, ActFinishActivity.class);startActivity(intent);第二种方式 Intent intent …概述 在Android中Intent是各个组件之间信息通信的桥梁它用于Android各组件的通信。 Intent 的组成部分 一、显式 Intent 第一种方式 Intent intent new Intent(this, ActFinishActivity.class);startActivity(intent);第二种方式 Intent intent new Intent();intent.setClass(this, ActFinishActivity.class);startActivity(intent);第三种方式 Intent intent new Intent();ComponentName componentName new ComponentName(this, ActFinishActivity.class);intent.setComponent(componentName);startActivity(intent);可以看出第一、二种比较简单且相似但是这两种方式都需要获取到要跳转的类。如果要跳到其他应用就不行了用 ComponentName 这种方式可以解决如下 ComponentName componentName new ComponentName(com.example.study_android, com.example.study_android.ActFinishActivity); 二、隐式 Intent 隐式 Intent 没有明确指定要跳转的目标活动只给出一个动作字符串让系统自动匹配属于模糊匹配。 常见系统动作的取值说明 动作名既可以通过 setAction 方法指定也可以通过构造函数 Intent(String action) 直接生成意图对象。跳转到拨号系统应用 private void handleNavHidden() {String phoneNo 12345;Intent intent new Intent();intent.setAction(Intent.ACTION_DIAL);Uri uri Uri.parse(tel: phoneNo);intent.setData(uri);startActivity(intent);}跳转到另一个APP private void handleNavMy() {Intent intent new Intent();intent.setAction(android.intent.action.MYAPP);intent.addCategory(Intent.CATEGORY_DEFAULT);startActivity(intent);}在另一个APP的主Activity中添加以下代码 intent-filteraction android:nameandroid.intent.action.MYAPP/category android:nameandroid.intent.category.DEFAULT //intent-filter三、向下一个Activity发送数据 Intent 使用 Bundle 对象存放待传递的数据信息。Bundle 对象操作各类型数据的读写方法说明见下表 通过 Bundle 传递 private void handleNextData() {Intent intent new Intent(this, ActFinishActivity.class);Bundle bundle new Bundle();long currentTimeMillis System.currentTimeMillis();bundle.putString(request_time, Long.toString(currentTimeMillis));bundle.putString(request_content, hello,world);intent.putExtras(bundle);startActivity(intent);}在跳转后的页面中接收 Bundle Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_act_finish);tv_descfindViewById(R.id.tv_desc);Bundle bundle getIntent().getExtras();String request_time bundle.getString(request_time);String request_content bundle.getString(request_content);String desc String.format(消息是%s,\n时间是%s, request_content, request_time);tv_desc.setText(desc);}也可以不通过Bundle直接传单个数据 intent.putExtra(name,张三);接收单个数据 String name getIntent().getStringExtra(name);四、向上一个Activity发送数据 步骤 当前页面通过 registerForActivityResult 注册回调 private ActivityResultLauncherIntent register;register registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result - {if (result ! null) {Intent intent result.getData();if (intent ! null result.getResultCode() Activity.RESULT_OK) {Bundle bundle intent.getExtras();String response_time bundle.getString(response_time);String response_content bundle.getString(response_content);String desc String.format(返回的消息是%s\n,时间%s, response_content, response_time);tv_res.setText(desc);}}});当前页面通过 register.launch 发起跳转 private void handleDataRes() {Intent intent new Intent(this, ActFinishActivity.class);Bundle bundle new Bundle();long currentTimeMillis System.currentTimeMillis();bundle.putString(request_time, Long.toString(currentTimeMillis));bundle.putString(request_content, hello,world);bundle.putString(name, 张三);intent.putExtras(bundle);register.launch(intent);}在下个页面调用 setResult 设置数据并通过 finish结束页面 public void onClick(View view) {Intent intent new Intent();Bundle bundle new Bundle();long currentTimeMillis System.currentTimeMillis();bundle.putString(response_time, Long.toString(currentTimeMillis));bundle.putString(response_content, 你好啊);intent.putExtras(bundle);// 携带意图返回上一个页面RESULT_OK 表示处理成功setResult(Activity.RESULT_OK, intent);// 结束当前活动页finish();}案例代码
http://www.w-s-a.com/news/120789/

相关文章:

  • 个人网站可以做淘客网站设置的参数
  • 自适应网站制作公司做室内设计通常上的网站
  • 网站建设项目采购公告建设网站公司建网页
  • 自己做网站怎么推广网站建设应该考虑哪些方面
  • 我做的网站手机上不了wordpress插件整站搬家
  • 河南省和建设厅网站首页西安找建网站公司
  • 网页设计基础代码网站进出成都最新通知
  • 如何创建网站乐清网络科技有限公司
  • 沈阳市网站制作艺术字体logo设计生成器
  • 网站设计常用软件都有哪些中国建设银行官方招聘网站
  • 证券投资网站建设视频直播怎么赚钱的
  • 建设酒店网站ppt模板下载郑州小程序设计外包
  • 网站建设自我总结google推广公司
  • 安全网站建设情况wordpress 评论表单
  • 网站建设发言材料个人网站推广软件
  • php建站软件哪个好南京哪家做网站好
  • 排名好的手机网站建设番禺网站建设专家
  • 番禺怎么读百度有专做优化的没
  • 网站开发中应注意哪些问题网络营销的主要特点
  • 网站定制案例北京网站制作招聘网
  • 网站建设与推广实训小结网站建设专业英文
  • 郑州网站建设动态凡科网站建设是免费的吗
  • 湖北手机网站建设wordpress转emlog博客
  • 北京东站设计网名的花样符号
  • 安徽建设厅网站首页网站开发aichengkeji
  • 自贡网站制作荣茂网站建设
  • 什么做的网站吗正规的机械外包加工订单网
  • 网络工程公司的业务邵阳seo快速排名
  • 博主怎么赚钱网站seo找准隐迅推
  • 营销号经典废话北京网站建设公司网站优化资讯