Start.java类对应一个登陆界面activity_Start.xml,通过显式Intent实现界面跳转至下一activity。
//Start.javapublic class Start extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_start);Button button1 = (Button)findViewById(R.id.button1);//寻找界面元素button1.setOnClickListener(new View.OnClickListener() //设置button1按钮监听器{@Overridepublic void onClick(View v) {//按钮点击Intent intent1 = new Intent(Start.this,Activity1.class);//按钮点击后实现界面跳转startActivity(intent1);}});}}
android:layout_width&#61;"match_parent"android:layout_height&#61;"match_parent"android:orientation&#61;"vertical">android:layout_width&#61;"match_parent"android:layout_height&#61;"wrap_content"android:layout_weight&#61;"1" >RelativeLayout><RelativeLayoutandroid:layout_width&#61;"match_parent"android:layout_height&#61;"wrap_content"android:layout_weight&#61;"1" ><Buttonandroid:id&#61;"&#64;&#43;id/button1"android:layout_width&#61;"150dp"android:layout_height&#61;"59dp"android:layout_centerInParent&#61;"true"android:textSize&#61;"22sp"android:text&#61;"进入游戏" />RelativeLayout>LinearLayout>