OKhttp,MVP,RecyclerView,联合使用,点击条目进入详情页

这篇博客介绍了如何将OKhttp用于网络请求,结合MVP设计模式和RecyclerView,实现点击RecyclerView条目后跳转到详情页面。详细内容包括布局设计(MainActivity.xml, Main2Activity.xml, item.xml),权限处理,以及关键代码部分如IView接口,GsonUtils,Presenter,RecyclerViewAdapter的实现。" 84307421,7334945,Java自学指南:从入门到精通的学习路径,"['Java编程', 'Java技术', 'Java框架', 'Java书籍', 'Java视频']
摘要由CSDN通过智能技术生成

布局

----------------------------------------------------------MainActivity.xml----------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    tools:context="bwie.com.rikao33.MainActivity">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </android.support.v7.widget.RecyclerView>

</LinearLayout>

----------------------------------------------------Main2Activity.xml---------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    tools:context="bwie.com.rikao33.Main2Activity">

    <TextView
        android:id="@+id/main2_tv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="界面二"/>



</LinearLayout>

-----------------------------------------------------item.xml------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">



    <ImageView
        android:id="@+id/img"
        android
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值