zoukankan      html  css  js  c++  java
  • 十天冲刺(第一阶段)

    今天学习了相关的数据库操作以及页面的跳转实验了一下再界面上简单的输出一下所求的数据,为下一步整合数据进行相关操作做铺垫:,比原生的一些东西要好用效率高太多

    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
            View view = inflater.inflate(R.layout.si_fragment,container,false);
            mDatabaseHelper = new DatabaseHelper(getActivity());
            mCostBeanList = new ArrayList<>();
             mTextView = view.findViewById(R.id.textView);
             button = view.findViewById(R.id.button2);
             editText = view.findViewById(R.id.editText2);
             button.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
                     String i = editText.getText().toString();
                     Cursor cursor =mDatabaseHelper.selectlist(i);
                     if (cursor != null){
                         while (cursor.moveToNext()){
                             CostBean costBean = new CostBean();
                             costBean.costTitle = cursor.getString(cursor.getColumnIndex("cost_title"));
                             costBean.costDate = cursor.getString(cursor.getColumnIndex("cost_date"));
                             costBean.costMoney = cursor.getString(cursor.getColumnIndex("cost_money"));
                             mCostBeanList.add(costBean);

                         }
                 }
                     String s = "";
                     for(int j = 0;j<mCostBeanList.size();j++){
                         s += mCostBeanList.get(j).getCostTitle();
                     }
                     mTextView.setText(s);
                 }
             });
            return view;
        }
  • 相关阅读:
    HTML meta viewport属性说明(mark)
    利用css样式画各种图形初步、进阶、高级(一)
    sql where 1=1和 0=1 的作用
    java日志文件log4j.properties配置详解
    VB面向对象编程
    怎么上传代码?
    Spring中部署Activiti流程定义的三种姿势
    不会使用Spring的配置文件,赶紧把这个甩给他
    一起玩转玩转LiteOS组件:Opus
    带你读AI论文丨RAID2020 Cyber Threat Intelligence Modeling GCN
  • 原文地址:https://www.cnblogs.com/guziteng1/p/13043843.html
Copyright © 2011-2022 走看看