很基础的intent界面跳转。实现从第一个界面跳转到第二个界面,并从第一个界面传递一个字符串过去。
首先看MainActivity的布局文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.czj01.intenttest.MainActivity">
<Button
android:id="@+id/btn_toSecond"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/str_jump"/>
</RelativeLayout>
再看第二个界面的布局
<?xml version="