目录
实验内容:
本次作业内容为:在实验二(在APP界面中添加recyclerView)的基础上,对有recycleView的页面进行点击跳转设计。比如,某一tab页是新闻列表,则点击某一行能跳转到新闻详情页面;
考察内容:对activity的生命周期的理解以及状态转变操作;
结果展示:
一.为跳转界面编写主函数和设计布局
1.在manifest中注册MainActivity2
<activity
android:name=".MainActivity2"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
2. 设计布局
因为页面的recyclerview是联系人信息,所以在跳转界面里我设计为联系人的详细信息,应该有联系人的头像,个人信息,以及他的签名(简介),另外还有朋友圈和更多信息两个跳转界面,但这一次我并有设计它们的点击事件.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="wrap_content"
android:orienta