冲刺(七)

ListView用法,适配器的简单使用代码

package com.example.twj.testyixue;

        import android.app.Activity;
        import android.os.Bundle;
        import android.widget.ListView;

/**
 * Created by t'w'j on 2020/4/18.
 */
public class ListViewDemoActivity extends Activity {
    private ListView mphoneBookListView;

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

        mphoneBookListView=(ListView)findViewById(R.id.list_view);

        PhoneBookAdapter phoneBookAdapter=new PhoneBookAdapter(ListViewDemoActivity.this);
        mphoneBookListView.setAdapter(phoneBookAdapter);

    }
}

  

posted @ 2020-04-24 13:55  天公疼憨仔队  阅读(97)  评论(0编辑  收藏  举报