小说结尾好看排行榜

现在的小说推荐算法是看的人越多就越有可能被推荐,那看的人少的优秀作品就不容易被发现。这类作品往往前面不够吸引人,但中后期精彩。那搞一个最新3章好看排行榜可能会解决这个问题。

<?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="match_parent"
    android:orientation="vertical"
 >
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="小说结尾排行榜"
        android:textColor="#ff0000"
        />
    <ListView
        android:id="@+id/list_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</LinearLayout>
package com.example.myapplication5;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class ListActivity extends AppCompatActivity {

    ListView listView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_list);

        //2、绑定控件
        listView=(ListView) findViewById(R.id.list_view);
        //3、准备数据
        String[] data={"斗破苍穹","神印王座","大唐双龙传","诛仙"};
        //4、创建适配器 连接数据源和控件的桥梁
        //参数 1:当前的上下文环境
        //参数 2:当前列表项所加载的布局文件
        //(android.R.layout.simple_list_item_1)这里的布局文件是Android内置的,里面只有一个textview控件用来显示简单的文本内容
        //参数 3:数据源
        ArrayAdapter<String> adapter=new ArrayAdapter<>(ListActivity.this,android.R.layout.simple_list_item_1,data);
        //5、将适配器加载到控件中
        listView.setAdapter(adapter);

    }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值