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;
        }
  • 相关阅读:
    登陆中发现css页面不见了,变成了光秃秃的输入框问题
    servlet基础一
    解决问题:Error:(5, 59) java: 程序包javax.servlet.http不存在
    静态方法的引用
    登录功能之添加验证码(包含切换验证码)
    生成图片验证码(VerifyCode)
    idea编辑器中批量完成注释及批量取消注释
    jdbc连接测试
    利用IO流复制图片
    js 判空
  • 原文地址:https://www.cnblogs.com/guziteng1/p/13043843.html
Copyright © 2011-2022 走看看