Fork me on GitHub

2017年1月2日

Activity启动模式

摘要: siwuxie095 共4种启动模式:standard singleTop singleTask singleInstance 1、标准启动模式(standard) 也即默认的启动模式 (1)先创建一个项目:LaunchMode,选择API:21 Android 5.0 选择Empty Activi 阅读全文

posted @ 2017-01-02 23:01 siwuxie095 阅读(218) 评论(0) 推荐(0) 编辑

Activity之间传递参数(四)

摘要: siwuxie095 获取Activity的返回参数 1、首先修改两个布局文件,都修改为 LinearLayout 布局, 添加orientation属性为:vertical。 (1)为 activity_main.xml 添加一个 TextView,用于显示返回的数据 <?xml version= 阅读全文

posted @ 2017-01-02 19:27 siwuxie095 阅读(259) 评论(0) 推荐(0) 编辑

Activity之间传递参数(三)

摘要: ------siwuxie095 传递值对象,即自定义的有数据类型的对象 1、首先 new 一个 class:User,用于创建自定义对象,同时右键 Generate 出 Constructor、setter 和 getter 方法(很简单,也可以手敲): package com.siwuxie095.sendargs; /** ... 阅读全文

posted @ 2017-01-02 02:33 siwuxie095 阅读(268) 评论(0) 推荐(0) 编辑

Activity之间传递参数(二)

摘要: ------siwuxie095 传递数据包 1、传递数据包要用到Bundle,MainActivity.java中: package com.siwuxie095.sendargs; import android.content.Intent; import android.support.v7.app.AppCompatActivity; ... 阅读全文

posted @ 2017-01-02 01:05 siwuxie095 阅读(232) 评论(0) 推荐(0) 编辑

导航