Android开发笔记(8)——调用子Activity
调用子Activity
需要子Activity返回值
|
MainActivity使用startActivityForResult方法
|
毋需子Activity返回值
|
MainActivity使用startActivity方法
|
MainActivity传值子Activity
|
直接设置intent.putExtras
|
MainActivity传值时:
- Intent intent =new Intent(MainActivity.this,subActivity.class);
- intent.putExtra(“value_key”,传输的值)
- Intent intent = getIntent();
- intent.getIntExtra(“value_key”,0);
- Intent intent =new Intent(MainActivity.this,subActivity.class);
- startActivityForResult(intent,0x1001);
- Intent.intent=new Intent();
- intent.putExtra(“revalue_key”,传回值);
- setResult(0x1001,intent);
- @override
- super.onActivityResult(requestCode,resultCode,data){
- if(requestCode==0x1001){
- String str =data.getStringExtra(“revalue_key”);}
- }
申明:
1、本笔记为文字及图片均为个人原创,转载请注明博客园-igoslly
2、Android开发课程于2017年4年参与GoogleDeveloper进行学习,笔记原版http://www.studyjamscn.com/thread-20580-1-1.html#pid272486
Android开发笔记(8)——调用子Activity的更多相关文章
- 【Android开发笔记】返回上层Activity的正确打开方式
技术支持 http://stackoverflow.com/questions/12276027/how-can-i-return-to-a-parent-activity-correctly 首先, ...
- android开发源代码分析--多个activity调用多个jni库的方法
android开发源代码分析--多个activity调用多个jni库的方法 有时候,我们在开发android项目时会遇到须要调用多个native c/jni库文件,下面是本人以前实现过的方法,假设有知 ...
- [置顶] Android开发笔记(成长轨迹)
分类: 开发学习笔记2013-06-21 09:44 26043人阅读 评论(5) 收藏 Android开发笔记 1.控制台输出:called unimplemented OpenGL ES API ...
- 【转】Android开发笔记(序)写在前面的目录
原文:http://blog.csdn.net/aqi00/article/details/50012511 知识点分类 一方面写写自己走过的弯路掉进去的坑,避免以后再犯:另一方面希望通过分享自己的经 ...
- Android开发笔记——以Volley图片加载、缓存、请求及展示为例理解Volley架构设计
Volley是由Google开源的.用于Android平台上的网络通信库.Volley通过优化Android的网络请求流程,形成了以Request-RequestQueue-Response为主线的网 ...
- Android开发笔记(一百三十四)协调布局CoordinatorLayout
协调布局CoordinatorLayout Android自5.0之后对UI做了较大的提升.一个重大的改进是推出了MaterialDesign库,而该库的基础即为协调布局CoordinatorLayo ...
- Android开发笔记--hello world 和目录结构
原文:Android开发笔记--hello world 和目录结构 每接触一个新东西 都有一个hello world的例子. 1.新建项目 2.配置AVD AVD 没有要新建个,如果不能创建 运行SD ...
- 【转】Android开发笔记——圆角和边框们
原文地址:http://blog.xianqu.org/2012/04/android-borders-and-radius-corners/ Android开发笔记——圆角和边框们 在做Androi ...
- Android开发_如何调用系统默认浏览器访问
Android开发_如何调用系统默认浏览器访问 2015-10-20 17:53 312人阅读 http://blog.sina.com.cn/s/blog_6efce07e010142w7.htm ...
随机推荐
- 搭建Kafka运行环境-Mac版
停止kafka服务: kafka_2.12-0.10.2.1> bin/kafka-server-stop.sh kafka_2.12-0.10.2.1> bin/zookeeper-se ...
- IDA 宏定义
/* This file contains definitions used by the Hex-Rays decompiler output. It has type definitions an ...
- hdu 2844 多重背包二进制优化
//http://www.cnblogs.com/devil-91/archive/2012/05/16/2502710.html #include<stdio.h> #define N ...
- chrome源代码目录结构简介(版本4.1.249.1059)
为了对庞大的源码项目进行分析,先对源码目录树作一个简单的介绍,粗略的了解一下各个模块的功能分布情况,chrome源代码src目录下的结构如下图: app:该目录下的代码主要是和各个操作系统平台相关的应 ...
- A Complete Guide to Usage of ‘usermod’ command– 15 Practical Examples with Screenshots
https://www.tecmint.com/usermod-command-examples/ -------------------------------------------------- ...
- golang中select case 的用途到底是啥
https://nanxiao.gitbooks.io/golang-101-hacks/content/posts/select-operation.html ------------------- ...
- URAL 2031. Overturned Numbers (枚举)
2031. Overturned Numbers Time limit: 1.0 second Memory limit: 64 MB Little Pierre was surfing the In ...
- JAVA 网络长短连接
作为java的刚開始学习的人,看了网上的资料后,关于java的长短连接,感觉理解的不是非常深刻.结合自己的学习和网上的资料整理例如以下.不对之处请大家批评指正. ...
- 线段树专题 POJ3468 A Simple Problem with Integers
题意:n个点.m个操作.两种操作类型.C X Y K 表示区间[x,y]上每一个点值加k.Q X Y 求区间[x,y]的和 分析:线段树区间求和,裸模板 注意:结果会超int,要用long long ...
- LeetCode 290. Word Pattern (词语模式)
Given a pattern and a string str, find if str follows the same pattern. Here follow means a full mat ...