• JAVA日报


    换汤不换药之家庭记账本app开发(SecondActivity)

    package com.example.jizhang;

    import android.os.Bundle;
    import android.widget.EditText;

    import androidx.annotation.Nullable;
    import androidx.appcompat.app.AppCompatActivity;

    import dao.userdao;

    public class SecondActivity extends AppCompatActivity{
    private EditText editTextt1;
    private EditText editTextt2;
    private EditText editTextt3;
    private EditText editTextt4;
    private EditText editTextt5;
    private EditText editTextt6;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_second);
    InitData();
    }
    private void InitData(){
    editTextt1 = (EditText) findViewById(R.id.edt_eat2);
    editTextt2 = (EditText) findViewById(R.id.edt_play2);
    editTextt3 = (EditText) findViewById(R.id.edt_clothes2);
    editTextt4 = (EditText) findViewById(R.id.edt_live2);
    editTextt5 = (EditText) findViewById(R.id.edt_usual2);
    editTextt6 = (EditText) findViewById(R.id.edt_total);
    userdao userDao=userdao.getInstance(getApplicationContext());
    userDao.Initdata();
    // for(user u:userList){
    // eat=eat+Double.valueOf(u.getEat());
    // play=play+Double.valueOf(u.getPlay());
    // clothes=clothes+Double.valueOf(u.getClothes());
    // live=live+Double.valueOf(u.getLive());
    // usual=usual+Double.valueOf(u.getUsual());
    // }
    // userdao userDao = userdao.getInstance(getApplicationContext());
    // SQLiteDatabase db=userDao.getDb().getWritableDatabase();
    // Cursor cursor=db.query("tex",new String[]{"date","eat","play","clothes","live","usual"},null,null,null,null,null);
    // while(cursor.moveToNext()) {
    // eat = eat + Double.valueOf(cursor.getString(1));
    // play = play + Double.valueOf(cursor.getString(2));
    // clothes = clothes + Double.valueOf(cursor.getString(3));
    // live = live + Double.valueOf(cursor.getString(4));
    // usual = usual + Double.valueOf(cursor.getString(5));
    // }
    // total=eat+play+clothes+live+usual;

    editTextt1.setText(""+userDao.eat);
    editTextt2.setText(""+userDao.play);
    editTextt3.setText(""+userDao.clothes);
    editTextt4.setText(""+userDao.live);
    editTextt5.setText(""+userDao.usual);
    editTextt6.setText(""+userDao.total);
    userDao.clear();
    }

    }
  • 相关阅读:
    dotnet core部署方式两则:CLI、IIS
    oracle的loop等循环语句的几个用法小例子[转]
    NET Core 环境搭建和命令行CLI入门[转]
    电视不支持AirPlay镜像怎么办?苹果iPhone手机投屏三种方法
    haproxy+keepalived实现web集群高可用性[转]
    论程序员的时代焦虑与焦虑的缓解[转]
    使用C#压缩解压rar和zip格式文件
    C#获取并修改文件扩展名的方法
    普通码农的思维总结【转】
    T4生成实体,单张表和多张表
  • 原文地址:https://www.cnblogs.com/mumulailai/p/14909706.html
Copyright © 2020-2023  润新知