Android(安卓)Intent

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.junbuzhi.sample"

<activity

android:label="@string/intent_src_appname"

android:name=".intent.Activity1" > <!-- package加起来是完全类名-->

Intent 请求

1.Component name,启动目标Activityname

2.Action,目标Activity做什么

3.Extras,键值对. Intent.putExtra(String,Object)

In Activity1

Intent intent = new Intent();

//Intent.setClass(Context pageContext,Class<?> clazz)

Intent.setClass(Activity1.this, OtherActivity.class);

//发送短信

//Uri uri = Uri.parse(“smsto://0800000123”);

//Intent intent = new Intent(Intent.ACTION_SENDTO,uri);

Activity1.this.startActivity(intent)

In OtherActivity

Intent intent = getIntent()

Intent.getStringExtra(Stringname)