zoukankan      html  css  js  c++  java
  • 团队冲刺第二阶段09

    今天完成了统计使用便签的信息的部分,如当前笔记数,删除笔记数,已记字数等一系列统计。

    代码如下:

    public class StatsActivity extends Activity {
    
      @Override
      protected void onCreate (Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_stats);
        initData();
      }
    
    
      @SuppressLint("NewApi")
      private void initData () {
        class StatsTask extends AsyncTask<Void, Void, Stats> {
    
          @Override
          protected Stats doInBackground (Void... params) {
            return (DbHelper.getInstance()).getStats();
          }
    
    
          @Override
          protected void onPostExecute (Stats result) {
            populateViews(result);
          }
        }
    
        new StatsTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      }
    
    
      private void populateViews (Stats mStats) {
        ((TextView) findViewById(R.id.stat_notes_total)).setText(String.valueOf(mStats.getNotesTotalNumber()));
        ((TextView) findViewById(R.id.stat_notes_active)).setText(String.valueOf(mStats.getNotesActive()));
        ((TextView) findViewById(R.id.stat_notes_archived)).setText(String.valueOf(mStats.getNotesArchived()));
        ((TextView) findViewById(R.id.stat_notes_trashed)).setText(String.valueOf(mStats.getNotesTrashed()));
        ((TextView) findViewById(R.id.stat_reminders)).setText(String.valueOf(mStats.getReminders()));
        ((TextView) findViewById(R.id.stat_reminders_futures)).setText(String.valueOf(mStats.getRemindersFutures()));
        ((TextView) findViewById(R.id.stat_checklists)).setText(String.valueOf(mStats.getNotesChecklist()));
        ((TextView) findViewById(R.id.stat_masked)).setText(String.valueOf(mStats.getNotesMasked()));
        ((TextView) findViewById(R.id.stat_categories)).setText(String.valueOf(mStats.getCategories()));
        ((TextView) findViewById(R.id.stat_tags)).setText(String.valueOf(mStats.getTags()));
    
        ((TextView) findViewById(R.id.stat_attachments)).setText(String.valueOf(mStats.getAttachments()));
        ((TextView) findViewById(R.id.stat_attachments_images)).setText(String.valueOf(mStats.getImages()));
        ((TextView) findViewById(R.id.stat_attachments_videos)).setText(String.valueOf(mStats.getVideos()));
        ((TextView) findViewById(R.id.stat_attachments_audiorecordings)).setText(String.valueOf(mStats
            .getAudioRecordings()));
        ((TextView) findViewById(R.id.stat_attachments_sketches)).setText(String.valueOf(mStats.getSketches()));
        ((TextView) findViewById(R.id.stat_attachments_files)).setText(String.valueOf(mStats.getFiles()));
        ((TextView) findViewById(R.id.stat_locations)).setText(String.valueOf(mStats.getLocation()));
    
        ((TextView) findViewById(R.id.stat_words)).setText(String.valueOf(mStats.getWords()));
        ((TextView) findViewById(R.id.stat_words_max)).setText(String.valueOf(mStats.getWordsMax()));
        ((TextView) findViewById(R.id.stat_words_avg)).setText(String.valueOf(mStats.getWordsAvg()));
        ((TextView) findViewById(R.id.stat_chars)).setText(String.valueOf(mStats.getChars()));
        ((TextView) findViewById(R.id.stat_chars_max)).setText(String.valueOf(mStats.getCharsMax()));
        ((TextView) findViewById(R.id.stat_chars_avg)).setText(String.valueOf(mStats.getCharsAvg()));
      }
    }
    

      

  • 相关阅读:
    C# 将DLL制作CAB包并在浏览器下载,自动安装。(Activex)(包括ie打开cab包一直弹出用户账户控制,确定之后无反应的解决办法。)
    C#解决WebClient不能下载https网页内容
    SQL Server 将两行或者多行拼接成一行数据
    IIS反向代理
    C# HTTP请求对外接口、第三方接口公用类
    SQL SERVER常用语法记录
    SQL SERVER 实现相同记录为空显示(多列去除重复值,相同的只显示一条数据)
    百度编辑器插入视频 实现可实时预览以及支持手机查看
    百度编辑器 动态修改上传图片路径以及上传视频路径
    .Net Core Api发布时报502.5 [The Application process failed to Start]问题的解决原因
  • 原文地址:https://www.cnblogs.com/cfypd/p/13088127.html
Copyright © 2011-2022 走看看