简单的RecyclerView显示,结合bmob(管理员发布通知例子)

该博客介绍了如何在Android应用中结合bmob数据服务,利用RecyclerView展示管理员发布的通知。首先,需要在build.gradle文件中添加RecyclerView的依赖。接着,设置数据,并创建notifications.xml布局文件来显示通知内容。在activity的XML布局中添加RecyclerView,然后在Activity中进行适配器的设置,继承RecyclerView.Adapter,完成数据绑定。最终,成功展示了通知列表的效果。
摘要由CSDN通过智能技术生成

首先在build.gradle添加RecyclerView依赖

implementation 'com.android.support:recyclerview-v7:28.0.0'

设置数据

public class Notification  extends BmobObject{ 
    private String notification;
    private String updateAt_data;
    //省略get,set
}

新建一个notifications.xml 显示通知

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="100dp">
    <TextView
        android:id="@+id/tv_notification"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:textSize="15sp"
        android:layout_marginTop="3dp"
        />
    <TextView
        android:id="@+id/news_
  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值