zoukankan      html  css  js  c++  java
  • 每日总结2.18

    今天搞体温上报App

    代码如下

    myadapter.java

    package com.example.dell.tiwen;

    import android.content.Context;
    import android.database.Cursor;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.BaseAdapter;
    import android.widget.LinearLayout;
    import android.widget.TextView;

    public class


    Myadapter extends BaseAdapter {

    private Context context;
    private Cursor cursor;
    private LinearLayout layout;
    public Myadapter(Context context,Cursor cursor){
    this.context=context;
    this.cursor=cursor;
    }
    @Override
    public int getCount() {
    return cursor.getCount();
    }

    @Override
    public Object getItem(int position) {
    return cursor.getPosition();
    }

    @Override
    public long getItemId(int position) {
    return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
    LayoutInflater inflater = LayoutInflater.from(context);
    layout = (LinearLayout) inflater.inflate(R.layout.cell,null);
    TextView tiwentv = layout.findViewById(R.id.list_tiwen);
    TextView timetv = layout.findViewById(R.id.list_time);
    TextView didiantv = layout.findViewById(R.id.list_didian);
    TextView nametv = layout.findViewById(R.id.list_name);
    cursor.moveToPosition(position);
    String tiwen = cursor.getString(cursor.getColumnIndex("tiwen"));
    String time = cursor.getString(cursor.getColumnIndex("time"));
    String name = cursor.getString(cursor.getColumnIndex("name"));
    String didian = cursor.getString(cursor.getColumnIndex("didian"));
    timetv.setText(time);
    didiantv.setText(didian);
    nametv.setText(name);
    tiwentv.setText(tiwen);
    return layout;
    }
    }
  • 相关阅读:
    php 内置的 webserver 研究。
    php 系列
    git 以及 github 使用系列
    中午和同事聊天,了解的一点网络方面的东西。
    javascript中0.01*2324=23.240000000000002 ?
    javascript的 replace() 方法的使用讲解
    PHP中的ORM
    javascript 函数 add(1)(2)(3)(4)实现无限极累加 —— 一步一步原理解析
    animate.css
    面向对象编程
  • 原文地址:https://www.cnblogs.com/wanghaoning/p/14913968.html
Copyright © 2011-2022 走看看