每日总结 4.15
今天进行了每日总销售额的计算显示。
package com.example.jjt; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.os.Handler; import android.widget.TextView; public class ZDActivity extends AppCompatActivity { private Handler handler=new Handler(); TextView name,zd; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_zdactivity); name=findViewById(R.id.tv_name); zd=findViewById(R.id.tv_zd); xianshi(); } private void xianshi() { new Thread(new Runnable() { @Override public void run() { String s1=name.getText().toString(); int ss=Dbhelper.zd(s1); String sss=String.valueOf(ss); handler.post(new Runnable() { @Override public void run() { zd.setText(sss); } }); } }).start(); } }