1、自动跳转
这里分享两种方法:
- 第一个:点击按钮实现跳转
新建项目 如下图点击之后自定义一个项目名一直下一步就行
项目结构是这样的
右击src里面的com.xxx.xxx
如下图点击other
然后是一下页面点开Android点击Android activity
然后一直下一步到这个页面
把Main换成Two注意第一个字母必须大写
第二页面创建就完成了
然后点开项目里面res下面的layout点击 main这是第一个页面 点开
点开之后点击进入代码页面
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.dddd.MainActivity" >
<!-- 定义一个按钮 -->
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="110dp"