010 Android programming 3rd 第二个activity android sdk

主要学习新建一个activity,已经彼此之间如何传递数据。

在manifest中申明activity.

一个activity启动另一个activity.

When an activity calls startActivity(Intent), this call is sent to the OS.

In particular, it is sent to a part of the OS called the ActivityManager.

The ActivityManager then creates the Activity instance and calls its onCreate(Bundle) method.

四大组件

Activities, services, broadcast receivers, content providers.

Intent解释

显式intent, 和隐式intent

Activity之间传输数据

将是否对错送到CheatActivity中,使用intent中的extra变量。


Note that Activity.getIntent() always returns the Intent that started the activity.

消息应答

When you want to hear back from the child activity, you call the following Activity method

public void startActityForResult(Intent intent, int requestCode);


You can modify the minimum SDK version, target SDK version, and compile SDK version in your build.gradle file, but nore that modification of this file requires that you sync your project with the Gradle changes before they will be reflected.

To do this, select Tools - Android - Sync Project with Gradle Files. This will trigger a fresh build of your project with the updated values.

The Build.VERSION.SDK_INT constant is the device's version of Android. You then compare that version with the constant that stand for the Lollipop release.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值